Browse Source

add support for realip

susefix
Kent Shultz 10 years ago
parent
commit
3616bcc9cf
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      nginx/templates/config.jinja

+ 8
- 0
nginx/templates/config.jinja View File

} }


http { http {
{% if 'set_real_ips' in nginx -%}
{% for ip in nginx.get('set_real_ips', {}).get('ips', []) -%}
set_real_ip_from {{ ip }};
{% endfor -%}
real_ip_header {{ nginx.get('set_real_ips', {}).get('real_ip_header', 'X-Forwarded-For') }};

{% endif -%}

include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
log_format main '$scheme://$host:$server_port$uri$is_args$args $remote_addr:$remote_user "$request" $request_time $request_length:$bytes_sent $status "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'; log_format main '$scheme://$host:$server_port$uri$is_args$args $remote_addr:$remote_user "$request" $request_time $request_length:$bytes_sent $status "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';

Loading…
Cancel
Save