Skip to content

Commit 3d80759

Browse files
committed
Renames the $upstream variables and does not append $request_ui if capture group exists in location
1 parent d95cd36 commit 3d80759

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/templates/_location.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
location {{ path }} {
2-
set $upstream {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}$request_uri;
2+
set $targetUri {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }}{% unless path contains "(" %}$request_uri{% endunless %};
33
proxy_set_header Host $host;
44
proxy_set_header X-Forwarded-Scheme $scheme;
55
proxy_set_header X-Forwarded-Proto $scheme;
66
proxy_set_header X-Forwarded-For $remote_addr;
77
proxy_set_header X-Real-IP $remote_addr;
8-
proxy_pass $upstream;
8+
proxy_pass $targetUri;
99

1010
{% if access_list_id > 0 %}
1111
{% if access_list.items.length > 0 %}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
set $upstream $forward_scheme://$server:$port$request_uri;
1+
set $targetUri $forward_scheme://$server:$port$request_uri;
22
add_header X-Served-By $host;
33
proxy_set_header Host $host;
44
proxy_set_header X-Forwarded-Scheme $scheme;
55
proxy_set_header X-Forwarded-Proto $scheme;
66
proxy_set_header X-Forwarded-For $remote_addr;
77
proxy_set_header X-Real-IP $remote_addr;
8-
proxy_pass $upstream;
8+
proxy_pass $targetUri;
99

0 commit comments

Comments
 (0)