Removed proxy_set_header from _location.conf and added defaults in location schema

This commit is contained in:
Edoardo Viviani 2022-02-09 12:32:11 +01:00
parent 8e5255a275
commit cb28f983ee
2 changed files with 5 additions and 6 deletions

View file

@ -1,9 +1,4 @@
location {{ path }} {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};
{% if access_list_id > 0 %}

View file

@ -7,7 +7,11 @@ const model = Backbone.Model.extend({
return {
opened: false,
path: '',
advanced_config: '',
advanced_config: 'proxy_set_header Host $host;\n' +
'proxy_set_header X-Forwarded-Scheme $scheme;\n' +
'proxy_set_header X-Forwarded-Proto $scheme;\n' +
'proxy_set_header X-Forwarded-For $remote_addr;\n' +
'proxy_set_header X-Real-IP $remote_addr;',
forward_scheme: 'http',
forward_host: '',
forward_port: '80'