Skip to content

Commit

Permalink
Caddy: strip query params from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Andraz Vrhovec committed Nov 21, 2020
1 parent 9efbe74 commit f5fbc61
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
:80 {
root * /srv
try_files {path}
file_server {
index index.html
}
handle_errors {
@404 {
expression {http.error.status_code} == 404
}
redir @404 / 301
}
}
root * /srv
try_files {path}
file_server {
index index.html
}
handle_errors {
@404 {
expression {http.error.status_code} == 404
}
redir @404 / 301
}
@query {
not query ""
}
redir @query / 301
}

0 comments on commit f5fbc61

Please sign in to comment.