Skip to content

Commit

Permalink
Fix nginx.cfg for alias resolve when using JSON
Browse files Browse the repository at this point in the history
fixes #181

The location/proxy_pass rule stripped the rest of the request URL.
This makes sure the url arguments are passed on to backend correctly.

See also: https://dev.to/danielkun/nginx-everything-about-proxypass-2ona
  • Loading branch information
cryptix committed Apr 21, 2021
1 parent 36cd8fc commit 02303fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/nginx-example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ server {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8899/alias/$alias;
# "rewrite" requests with subdomains to the non-wildcard url for alias resolving
# $is_args$args pass on ?encoding=json if present
proxy_pass http://localhost:8899/alias/$alias$is_args$args;
}

location / {
Expand Down

0 comments on commit 02303fc

Please sign in to comment.