diff --git a/salt/nginx/config/realip-nginx.jinja.conf b/salt/nginx/config/realip-nginx.jinja.conf new file mode 100644 index 00000000..b5ea92d6 --- /dev/null +++ b/salt/nginx/config/realip-nginx.jinja.conf @@ -0,0 +1,4 @@ +# Real IP Configuration +set_real_ip_from {{ pillar["psf_internal_network"] }}; +set_real_ip_from 127.0.0.1; +real_ip_header X-Forwarded-For; diff --git a/salt/nginx/init.sls b/salt/nginx/init.sls index 158dddd5..71a702d4 100644 --- a/salt/nginx/init.sls +++ b/salt/nginx/init.sls @@ -94,6 +94,15 @@ nginx: - require: - pkg: nginx +/etc/nginx/sites.d/realip.conf: + file.managed: + - source: salt://nginx/config/realip-nginx.jinja.conf + - template: jinja + - user: root + - group: root + - mode: "0644" + - require: + - file: /etc/nginx/sites.d/ /etc/logrotate.d/nginx: file.managed: