diff --git a/library/roles/nginx/defaults/main.yml b/library/roles/nginx/defaults/main.yml index 6391301..cf21aa9 100644 --- a/library/roles/nginx/defaults/main.yml +++ b/library/roles/nginx/defaults/main.yml @@ -46,6 +46,7 @@ nginx_css_js_cache_expire: -1 nginx_reverse_proxy: False nginx_define_x_real_ip: False +nginx_set_original_uri: True nginx_proxy_buffering: "on" nginx_proxy_redirect: "off" nginx_proxy_buffer_size: 128k diff --git a/library/roles/nginx/templates/nginx-proxy-params.conf.j2 b/library/roles/nginx/templates/nginx-proxy-params.conf.j2 index 7a92c12..2d834a4 100644 --- a/library/roles/nginx/templates/nginx-proxy-params.conf.j2 +++ b/library/roles/nginx/templates/nginx-proxy-params.conf.j2 @@ -13,6 +13,9 @@ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; {% endif %} {% endif %} +{% if nginx_set_original_uri %} +proxy_set_header nginx-request-uri $request_uri; +{% endif %} proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering {{ nginx_proxy_buffering }};