Skip to content

Commit c203d1a

Browse files
committed
Requires ~() in location to remove $request_uri and removes $request_uri if it is just a slash
1 parent 3d80759 commit c203d1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/templates/_location.conf

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
location {{ path }} {
2-
set $targetUri {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}{% unless path contains "(" %}$request_uri{% endunless %};
2+
set $targetUri {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};
3+
{% unless path contains "~" and path contains "(" and path contains ")" %}
4+
if ($request_uri != /){
5+
set $targetUri $targetUri$request_uri;
6+
}
7+
{% endunless %}
38
proxy_set_header Host $host;
49
proxy_set_header X-Forwarded-Scheme $scheme;
510
proxy_set_header X-Forwarded-Proto $scheme;

0 commit comments

Comments
 (0)