Skip to content

Commit

Permalink
nginx: Do not attempt to parse and rewrite our URLs, please
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Jul 30, 2021
1 parent c86839e commit 8f5f95b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion deployment/docker/nginx.conf
Expand Up @@ -68,7 +68,14 @@ http {
add_header Cache-Control "public";
}
location / {
proxy_pass http://unix:/tmp/pretix.sock:/;
# Very important:
# proxy_pass http://unix:/tmp/pretix.sock:;
# is not the same as
# proxy_pass http://unix:/tmp/pretix.sock:/;
# In the latter case, nginx will apply its URL parsing, in the former it doesn't.
# There are situations in which pretix' API will deal with "file names" containing %2F%2F, which
# nginx will normalize to %2F, which can break ticket validation.
proxy_pass http://unix:/tmp/pretix.sock:;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
Expand Down
2 changes: 1 addition & 1 deletion doc/admin/installation/docker_smallscale.rst
Expand Up @@ -233,7 +233,7 @@ The following snippet is an example on how to configure a nginx proxy for pretix
ssl_certificate_key /path/to/key.pem;

location / {
proxy_pass http://localhost:8345/;
proxy_pass http://localhost:8345;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
Expand Down
2 changes: 1 addition & 1 deletion doc/admin/installation/manual_smallscale.rst
Expand Up @@ -237,7 +237,7 @@ The following snippet is an example on how to configure a nginx proxy for pretix
add_header X-Content-Type-Options nosniff;

location / {
proxy_pass http://localhost:8345/;
proxy_pass http://localhost:8345;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
Expand Down

0 comments on commit 8f5f95b

Please sign in to comment.