[GH-ISSUE #567] How to use custom configuration #475

Closed
opened 2026-02-26 06:32:59 +03:00 by kerem · 3 comments
Owner

Originally created by @adicrescenzo on GitHub (Aug 19, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/567

I need to use some custom ngnix configuration. In order to do that I've created the file /data/nginx/custom/server_proxy.conf with this settings:

server {
   
    listen 80;
    listen [::]:80;
    listen 443 ssl http2;
    listen [::]:443;

    # Let's Encrypt SSL
    include conf.d/include/letsencrypt-acme-challenge.conf;
    include conf.d/include/ssl-ciphers.conf;
    ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem;
    server_name "~^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$";

    location / {
        proxy_pass "<IP_ADDRESS>:<PORT>"
    }
}

How can I force ngnix to reload the settings and read this new file? I opened a shell on the ngnix-proxy-mangaer container and I launched the command

nginx -s reload

but I got this error:

nginx: [emerg] "http" directive is not allowed here in /data/nginx/custom/server_proxy.conf:1

Originally created by @adicrescenzo on GitHub (Aug 19, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/567 I need to use some custom ngnix configuration. In order to do that I've created the file `/data/nginx/custom/server_proxy.conf` with this settings: ``` server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443; # Let's Encrypt SSL include conf.d/include/letsencrypt-acme-challenge.conf; include conf.d/include/ssl-ciphers.conf; ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem; server_name "~^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"; location / { proxy_pass "<IP_ADDRESS>:<PORT>" } } ``` How can I force ngnix to reload the settings and read this new file? I opened a shell on the **ngnix-proxy-mangaer** container and I launched the command `nginx -s reload` but I got this error: `nginx: [emerg] "http" directive is not allowed here in /data/nginx/custom/server_proxy.conf:1`
kerem 2026-02-26 06:32:59 +03:00
Author
Owner

@bitsvital commented on GitHub (Apr 22, 2021):

I had the same problem.
I went into /data/nginx/proxy_host and read the conf it states:
include /data/nginx/custom/server_proxy[.]conf;
Instaed of using proxy_manager.conf use proxy_manager1.conf or proxy_manager2.conf
proxy_magaer[#].conf
sub in the number for the correct proxy conf file in /data/nginx/proxy_host

<!-- gh-comment-id:825074141 --> @bitsvital commented on GitHub (Apr 22, 2021): I had the same problem. I went into /data/nginx/proxy_host and read the conf it states: `include /data/nginx/custom/server_proxy[.]conf;` Instaed of using proxy_manager.conf use proxy_manager1.conf or proxy_manager2.conf proxy_magaer[#].conf sub in the number for the correct proxy conf file in /data/nginx/proxy_host
Author
Owner

@github-actions[bot] commented on GitHub (Mar 26, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2019240170 --> @github-actions[bot] commented on GitHub (Mar 26, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (May 5, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2849747785 --> @github-actions[bot] commented on GitHub (May 5, 2025): Issue was closed due to inactivity.
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#475
No description provided.