[GH-ISSUE #2021] Unable to log Client IP #1462

Closed
opened 2026-02-26 07:31:10 +03:00 by kerem · 8 comments
Owner

Originally created by @fabienfitoussi on GitHub (Apr 21, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2021

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • No
  • Are you sure you're not using someone else's docker image?
    • No
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
Hello,

I try to find a solution to my issue in the previous ticket, but any solution tested worked for me.

I installed NPM on a docker with a mariadb.

In the access log, I only trace the docker IP of the NPM container, not the real client IP
My docker compose and the nginx conf of my proxy host in attachment
docker-compose..txt

Nginx Proxy Manager Version
v2.9.18

I can access to NPM administration throught a DNS : proxy.XXXX.fr
Here the proxy_host config :
5.txt

Expected behavior
I need to log the IP of the client (like 58.245.158.25), not the 172.18.2.1 which is the gateway's subnet IP of my docker network

[21/Apr/2022:10:49:20 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/" [Client 172.18.2.1] [Length 61] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"
[21/Apr/2022:10:49:20 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 172.18.2.1] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"

Operating System
I installed NPM with Portainer, on a docker hosted on a Synology NAS.

Originally created by @fabienfitoussi on GitHub (Apr 21, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2021 - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - No - Are you sure you're not using someone else's docker image? - No - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** Hello, I try to find a solution to my issue in the previous ticket, but any solution tested worked for me. I installed NPM on a docker with a mariadb. In the access log, I only trace the docker IP of the NPM container, not the real client IP My docker compose and the nginx conf of my proxy host in attachment [docker-compose..txt](https://github.com/NginxProxyManager/nginx-proxy-manager/files/8530312/docker-compose.txt) **Nginx Proxy Manager Version** v2.9.18 I can access to NPM administration throught a DNS : proxy.XXXX.fr Here the proxy_host config : [5.txt](https://github.com/NginxProxyManager/nginx-proxy-manager/files/8530311/5.txt) **Expected behavior** I need to log the IP of the client (like 58.245.158.25), not the 172.18.2.1 which is the gateway's subnet IP of my docker network ``` [21/Apr/2022:10:49:20 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/" [Client 172.18.2.1] [Length 61] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy" [21/Apr/2022:10:49:20 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 172.18.2.1] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy" ``` **Operating System** I installed NPM with Portainer, on a docker hosted on a Synology NAS.
kerem 2026-02-26 07:31:10 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fabienfitoussi commented on GitHub (Apr 21, 2022):

I found a fix for this issue !

In the /etc/nginx/nginx.conf, I replaced this :
real_ip_header X-Real-IP;
by this
real_ip_header X-Forwarded-For;

Now, I see the correct IP in the access log :
[21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"

To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume.

<!-- gh-comment-id:1105186582 --> @fabienfitoussi commented on GitHub (Apr 21, 2022): I found a fix for this issue ! In the /etc/nginx/nginx.conf, I replaced this : `real_ip_header X-Real-IP;` by this `real_ip_header X-Forwarded-For;` Now, I see the correct IP in the access log : `[21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"` To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume.
Author
Owner

@Anmours commented on GitHub (May 13, 2022):

Hello, I did what you said, but it didn't achieve the expected effect. The version number is the same as you. Are you using it normally now?

<!-- gh-comment-id:1125627094 --> @Anmours commented on GitHub (May 13, 2022): Hello, I did what you said, but it didn't achieve the expected effect. The version number is the same as you. Are you using it normally now?
Author
Owner

@orochon commented on GitHub (Jun 22, 2022):

I found a fix for this issue !

In the /etc/nginx/nginx.conf, I replaced this : real_ip_header X-Real-IP; by this real_ip_header X-Forwarded-For;

Now, I see the correct IP in the access log : [21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"

To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume.

I've been struggling for hours on this problem, still can't resolve it.
I did the same modification as you at the nginx.conf, and I mount it with a volume.
When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For.
But, even with this modification, I still only see the docker gateway in the logs :(

<!-- gh-comment-id:1162579583 --> @orochon commented on GitHub (Jun 22, 2022): > I found a fix for this issue ! > > In the /etc/nginx/nginx.conf, I replaced this : `real_ip_header X-Real-IP;` by this `real_ip_header X-Forwarded-For;` > > Now, I see the correct IP in the access log : `[21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"` > > To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume. I've been struggling for hours on this problem, still can't resolve it. I did the same modification as you at the nginx.conf, and I mount it with a volume. When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For. But, even with this modification, I still only see the docker gateway in the logs :(
Author
Owner

@Anmours commented on GitHub (Jun 22, 2022):

I found a fix for this issue !
In the /etc/nginx/nginx.conf, I replaced this : real_ip_header X-Real-IP; by this real_ip_header X-Forwarded-For;
Now, I see the correct IP in the access log : [21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"
To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume.

I've been struggling for hours on this problem, still can't resolve it. I did the same modification as you at the nginx.conf, and I mount it with a volume. When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For. But, even with this modification, I still only see the docker gateway in the logs :(

Like me, I didn't solve it as he said.

IP problems have plagued me for several months. Not long ago, I found a similar solution in another post. This may be a defect of Synology NAS docker. Please refer to: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/

This is my blog based on his plan. I come from China. hope you can understand Chinese~
https://blog.amings.cn/article/382.html

:)

<!-- gh-comment-id:1162590445 --> @Anmours commented on GitHub (Jun 22, 2022): > > I found a fix for this issue ! > > In the /etc/nginx/nginx.conf, I replaced this : `real_ip_header X-Real-IP;` by this `real_ip_header X-Forwarded-For;` > > Now, I see the correct IP in the access log : `[21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"` > > To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume. > > I've been struggling for hours on this problem, still can't resolve it. I did the same modification as you at the nginx.conf, and I mount it with a volume. When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For. But, even with this modification, I still only see the docker gateway in the logs :( Like me, I didn't solve it as he said. IP problems have plagued me for several months. Not long ago, I found a similar solution in another post. This may be a defect of Synology NAS docker. Please refer to: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/ This is my blog based on his plan. I come from China. hope you can understand Chinese~ https://blog.amings.cn/article/382.html :)
Author
Owner

@lemniskett commented on GitHub (Oct 17, 2022):

I found a fix for this issue !
In the /etc/nginx/nginx.conf, I replaced this : real_ip_header X-Real-IP; by this real_ip_header X-Forwarded-For;
Now, I see the correct IP in the access log : [21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"
To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume.

I've been struggling for hours on this problem, still can't resolve it. I did the same modification as you at the nginx.conf, and I mount it with a volume. When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For. But, even with this modification, I still only see the docker gateway in the logs :(

Like me, I didn't solve it as he said.

IP problems have plagued me for several months. Not long ago, I found a similar solution in another post. This may be a defect of Synology NAS docker. Please refer to: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/

This is my blog based on his plan. I come from China. hope you can understand Chinese~ https://blog.amings.cn/article/382.html

:)

Sorry for bumping, but this fixed the IP address seen from Keycloak behind NPM behind Cloudflare.

<!-- gh-comment-id:1280293811 --> @lemniskett commented on GitHub (Oct 17, 2022): > > > I found a fix for this issue ! > > > In the /etc/nginx/nginx.conf, I replaced this : `real_ip_header X-Real-IP;` by this `real_ip_header X-Forwarded-For;` > > > Now, I see the correct IP in the access log : `[21/Apr/2022:13:06:55 +0000] - 200 200 - GET https proxy.XXXX.fr "/api/users/me?expand=permissions" [Client 58.245.158.25] [Length 454] [Gzip -] [Sent-to 192.168.0.20] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" "https://proxy.XXXX.fr/nginx/proxy"` > > > To make this setting persistent, I created a nginx.conf on my host, and mount it to /etc/nginx/nginx.conf with a volume. > > > > > > I've been struggling for hours on this problem, still can't resolve it. I did the same modification as you at the nginx.conf, and I mount it with a volume. When I go to the CLI and do a cat ont the file, I see the X-Forwarded-For. But, even with this modification, I still only see the docker gateway in the logs :( > > Like me, I didn't solve it as he said. > > IP problems have plagued me for several months. Not long ago, I found a similar solution in another post. This may be a defect of Synology NAS docker. Please refer to: https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/ > > This is my blog based on his plan. I come from China. hope you can understand Chinese~ https://blog.amings.cn/article/382.html > > :) Sorry for bumping, but this fixed the IP address seen from Keycloak behind NPM behind Cloudflare.
Author
Owner

@GerritKuilder commented on GitHub (Dec 10, 2022):

I am trying to fix this too. getting the real ip address of the requests.

a) I cannot edit the nginx.con in the docker (which editor is used?)
b) I try to mount the /etc/nginx directory in a volume but that shows up blank after a restart and the proxied sites fail to work
volumes

  • ./nginx:/etc/nginx:rw

I am mainly proxying dockers and node apps

Any advice would be appreciated.

Gerrit kuilder

<!-- gh-comment-id:1345278729 --> @GerritKuilder commented on GitHub (Dec 10, 2022): I am trying to fix this too. getting the real ip address of the requests. a) I cannot edit the nginx.con in the docker (which editor is used?) b) I try to mount the /etc/nginx directory in a volume but that shows up blank after a restart and the proxied sites fail to work volumes - ./nginx:/etc/nginx:rw I am mainly proxying dockers and node apps Any advice would be appreciated. Gerrit kuilder
Author
Owner

@lemniskett commented on GitHub (Dec 11, 2022):

I am trying to fix this too. getting the real ip address of the requests.

a) I cannot edit the nginx.con in the docker (which editor is used?) b) I try to mount the /etc/nginx directory in a volume but that shows up blank after a restart and the proxied sites fail to work volumes

  • ./nginx:/etc/nginx:rw

I am mainly proxying dockers and node apps

Any advice would be appreciated.

Gerrit kuilder

Do not mount the whole directory, just mount the nginx.conf.

<!-- gh-comment-id:1345537563 --> @lemniskett commented on GitHub (Dec 11, 2022): > I am trying to fix this too. getting the real ip address of the requests. > > a) I cannot edit the nginx.con in the docker (which editor is used?) b) I try to mount the /etc/nginx directory in a volume but that shows up blank after a restart and the proxied sites fail to work volumes > > * ./nginx:/etc/nginx:rw > > I am mainly proxying dockers and node apps > > Any advice would be appreciated. > > Gerrit kuilder Do not mount the whole directory, just mount the nginx.conf.
Author
Owner

@fabienfitoussi commented on GitHub (Dec 12, 2022):

Hello,

I use Portainer on Synology NAS to manage my docker containers.
Here the docker-compose i'm currently using for NPM.
I didn't mount a directory, but only the nginx.conf as you can see.

I paste you the content of my nginx.conf just below.

docker-compose :

version: '3'
services:
  npm:
    image: jc21/nginx-proxy-manager:latest
    container_name: npm_app
    ports:
      - 8081:81
      - 8080:80
      - 8043:443
    environment:
      - DB_MYSQL_HOST=npm_db
      - DB_MYSQL_PORT=3306
      - DB_MYSQL_USER=USER_XXX
      - DB_MYSQL_PASSWORD=PWD_XXX
      - DB_MYSQL_NAME=npm
    volumes:
      - /volume1/docker/nginx-proxy-manager/data:/data
      - /volume1/docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt
      - /volume1/docker/nginx-proxy-manager/conf/nginx.conf:/etc/nginx/nginx.conf
    labels:
      - com.centurylinklabs.watchtower.enable=true
    restart: always
    links:
      - npm_db
    networks:
      - snet
  npm_db:
    image: jc21/mariadb-aria:latest
    container_name: npm_db
    environment:
      - MYSQL_ROOT_PASSWORD=npm
      - MYSQL_DATABASE=npm
      - MYSQL_USER=USER_XXX
      - MYSQL_PASSWORD=PWD_XXX
    volumes:
      - /volume1/docker/nginx-proxy-manager/db:/var/lib/mysql
    labels:
      - com.centurylinklabs.watchtower.enable=true
    restart: always
    networks:
      - snet

networks:
  snet:
    driver: bridge

    ipam:
      driver: default
      config:
        - subnet: "172.18.2.0/24"
          gateway: "172.18.2.1"

nginx.conf

# run nginx in foreground
daemon off;

user root;

# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto;

# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

error_log /data/logs/fallback_error.log warn;

# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;

events {
        worker_connections  1024;
}

http {
        include                       /etc/nginx/mime.types;
        default_type                  application/octet-stream;
        sendfile                      on;
        server_tokens                 off;
        tcp_nopush                    on;
        tcp_nodelay                   on;
        client_body_temp_path         /tmp/nginx/body 1 2;
        keepalive_timeout             90s;
        proxy_connect_timeout         90s;
        proxy_send_timeout            90s;
        proxy_read_timeout            90s;
        ssl_prefer_server_ciphers     on;
        gzip                          on;
        proxy_ignore_client_abort     off;
        client_max_body_size          2000m;
        server_names_hash_bucket_size 1024;
        proxy_http_version            1.1;
        proxy_set_header              X-Forwarded-Scheme $scheme;
        proxy_set_header              X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header              Accept-Encoding "";
        proxy_cache                   off;
        proxy_cache_path              /var/lib/nginx/cache/public  levels=1:2 keys_zone=public-cache:30m max_size=192m;
        proxy_cache_path              /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;

        log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
        log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

        access_log /data/logs/fallback_access.log proxy;

        # Dynamically generated resolvers file
        include /etc/nginx/conf.d/include/resolvers.conf;

        # Default upstream scheme
        map $host $forward_scheme {
                default http;
        }

        # Real IP Determination

        # Local subnets:
        set_real_ip_from 10.0.0.0/8;
        set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
        set_real_ip_from 192.168.0.0/16;
        # NPM generated CDN ip ranges:
        include conf.d/include/ip_ranges.conf;
        # always put the following 2 lines after ip subnets:
        real_ip_header X-Forwarded-For;
        real_ip_recursive on;

        # Custom
        include /data/nginx/custom/http_top[.]conf;

        # Files generated by NPM
        include /etc/nginx/conf.d/*.conf;
        include /data/nginx/default_host/*.conf;
        include /data/nginx/proxy_host/*.conf;
        include /data/nginx/redirection_host/*.conf;
        include /data/nginx/dead_host/*.conf;
        include /data/nginx/temp/*.conf;

        # Custom
        include /data/nginx/custom/http[.]conf;
}

stream {
        # Files generated by NPM
        include /data/nginx/stream/*.conf;

        # Custom
        include /data/nginx/custom/stream[.]conf;
}

# Custom
include /data/nginx/custom/root[.]conf;
<!-- gh-comment-id:1346082065 --> @fabienfitoussi commented on GitHub (Dec 12, 2022): Hello, I use Portainer on Synology NAS to manage my docker containers. Here the docker-compose i'm currently using for NPM. I didn't mount a directory, but only the nginx.conf as you can see. I paste you the content of my nginx.conf just below. **docker-compose :** ``` version: '3' services: npm: image: jc21/nginx-proxy-manager:latest container_name: npm_app ports: - 8081:81 - 8080:80 - 8043:443 environment: - DB_MYSQL_HOST=npm_db - DB_MYSQL_PORT=3306 - DB_MYSQL_USER=USER_XXX - DB_MYSQL_PASSWORD=PWD_XXX - DB_MYSQL_NAME=npm volumes: - /volume1/docker/nginx-proxy-manager/data:/data - /volume1/docker/nginx-proxy-manager/letsencrypt:/etc/letsencrypt - /volume1/docker/nginx-proxy-manager/conf/nginx.conf:/etc/nginx/nginx.conf labels: - com.centurylinklabs.watchtower.enable=true restart: always links: - npm_db networks: - snet npm_db: image: jc21/mariadb-aria:latest container_name: npm_db environment: - MYSQL_ROOT_PASSWORD=npm - MYSQL_DATABASE=npm - MYSQL_USER=USER_XXX - MYSQL_PASSWORD=PWD_XXX volumes: - /volume1/docker/nginx-proxy-manager/db:/var/lib/mysql labels: - com.centurylinklabs.watchtower.enable=true restart: always networks: - snet networks: snet: driver: bridge ipam: driver: default config: - subnet: "172.18.2.0/24" gateway: "172.18.2.1" ``` **nginx.conf** ``` # run nginx in foreground daemon off; user root; # Set number of worker processes automatically based on number of CPU cores. worker_processes auto; # Enables the use of JIT for regular expressions to speed-up their processing. pcre_jit on; error_log /data/logs/fallback_error.log warn; # Includes files with directives to load dynamic modules. include /etc/nginx/modules/*.conf; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; server_tokens off; tcp_nopush on; tcp_nodelay on; client_body_temp_path /tmp/nginx/body 1 2; keepalive_timeout 90s; proxy_connect_timeout 90s; proxy_send_timeout 90s; proxy_read_timeout 90s; ssl_prefer_server_ciphers on; gzip on; proxy_ignore_client_abort off; client_max_body_size 2000m; server_names_hash_bucket_size 1024; proxy_http_version 1.1; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Accept-Encoding ""; proxy_cache off; proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m; proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m; log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"'; log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"'; access_log /data/logs/fallback_access.log proxy; # Dynamically generated resolvers file include /etc/nginx/conf.d/include/resolvers.conf; # Default upstream scheme map $host $forward_scheme { default http; } # Real IP Determination # Local subnets: set_real_ip_from 10.0.0.0/8; set_real_ip_from 172.16.0.0/12; # Includes Docker subnet set_real_ip_from 192.168.0.0/16; # NPM generated CDN ip ranges: include conf.d/include/ip_ranges.conf; # always put the following 2 lines after ip subnets: real_ip_header X-Forwarded-For; real_ip_recursive on; # Custom include /data/nginx/custom/http_top[.]conf; # Files generated by NPM include /etc/nginx/conf.d/*.conf; include /data/nginx/default_host/*.conf; include /data/nginx/proxy_host/*.conf; include /data/nginx/redirection_host/*.conf; include /data/nginx/dead_host/*.conf; include /data/nginx/temp/*.conf; # Custom include /data/nginx/custom/http[.]conf; } stream { # Files generated by NPM include /data/nginx/stream/*.conf; # Custom include /data/nginx/custom/stream[.]conf; } # Custom include /data/nginx/custom/root[.]conf; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1462
No description provided.