Skip to content

Commit aa27092

Browse files
committed
Additional nginx config for real ip determination
1 parent 3836f7c commit aa27092

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

rootfs/etc/nginx/conf.d/default.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Generated IP Ranges for safe real IP determination
2-
include conf.d/include/ip_ranges.conf;
3-
41
# Healthcheck Host which proxies to the Manager,
52
# thus the healthcheck ensures both services are running
63
server {

rootfs/etc/nginx/nginx.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ http {
5959
default http;
6060
}
6161

62+
# Real IP Determination
63+
# Docker subnet:
64+
set_real_ip_from 172.0.0.0/8;
65+
# NPM generated CDN ip ranges:
66+
include conf.d/include/ip_ranges.conf;
67+
# always put the following 2 lines after ip subnets:
68+
real_ip_header X-Forwarded-For;
69+
real_ip_recursive on;
70+
6271
# Files generated by NPM
6372
include /etc/nginx/conf.d/*.conf;
6473
include /data/nginx/proxy_host/*.conf;

0 commit comments

Comments
 (0)