[GH-ISSUE #172] How to use Custom Nginx Configuration #153

Closed
opened 2026-02-26 06:30:51 +03:00 by kerem · 13 comments
Owner

Originally created by @jegged on GitHub (Jul 23, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/172

is there any examples to show how to use "Custom Nginx Configuration"
批注 2019-07-23 163436

Originally created by @jegged on GitHub (Jul 23, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/172 is there any examples to show how to use "Custom Nginx Configuration" ![批注 2019-07-23 163436](https://user-images.githubusercontent.com/5977574/61696549-22967300-ad68-11e9-8120-e5cf2f501818.png)
kerem 2026-02-26 06:30:51 +03:00
Author
Owner

@jc21 commented on GitHub (Jul 23, 2019):

No there isn't. It's a feature that's been added for advanced users with previous nginx knowledge. If you tell me what you're trying to achieve, I can give you a specific example.

<!-- gh-comment-id:514407056 --> @jc21 commented on GitHub (Jul 23, 2019): No there isn't. It's a feature that's been added for advanced users with previous nginx knowledge. If you tell me what you're trying to achieve, I can give you a specific example.
Author
Owner

@AiRC-ai commented on GitHub (Jul 24, 2019):

Sorry to highjack this thread but, I have a similar question.

I am trying to have nxgin do a Rewrite of the URL every time.

the problem is one of my site behind the reverse proxy is set for'
(http://example.com:8080/) & (https://example.com:8443/). it's an unifi controller and I can change the port to 80 and 443 without the service failing. so I just forwarded 8443 and 8080 to 80 and 443 but I really need it to perform a Rewrite as well every time to fix the issue.

So I need nxgin to change the http://example.com:8080 & https://example.com:8443/) to just https://example.com.

Any help would be great.

<!-- gh-comment-id:514711314 --> @AiRC-ai commented on GitHub (Jul 24, 2019): Sorry to highjack this thread but, I have a similar question. I am trying to have nxgin do a Rewrite of the URL every time. the problem is one of my site behind the reverse proxy is set for' (http://example.com:8080/) & (https://example.com:8443/). it's an unifi controller and I can change the port to 80 and 443 without the service failing. so I just forwarded 8443 and 8080 to 80 and 443 but I really need it to perform a Rewrite as well every time to fix the issue. So I need nxgin to change the http://example.com:8080 & https://example.com:8443/) to just https://example.com. Any help would be great.
Author
Owner

@AiRC-ai commented on GitHub (Jul 24, 2019):

I just can seem to use a standard Nxgin Rewrite.
I used this but it did not work.

server {
listen 8080;
listen 80;
listen 8443 ssl;
listen 443 ssl;
server_name www.old-name.com old-name.com;
return 301 $scheme://www.new-name.com$request_uri;
}

<!-- gh-comment-id:514781573 --> @AiRC-ai commented on GitHub (Jul 24, 2019): I just can seem to use a standard Nxgin Rewrite. I used this but it did not work. server { listen 8080; listen 80; listen 8443 ssl; listen 443 ssl; server_name www.old-name.com old-name.com; return 301 $scheme://www.new-name.com$request_uri; }
Author
Owner

@businesslogic360 commented on GitHub (Jul 26, 2019):

Hi, How can I use the same domain name with different ports? ID I want to add a new port the app shows that the domain is already in use.

<!-- gh-comment-id:515379414 --> @businesslogic360 commented on GitHub (Jul 26, 2019): Hi, How can I use the same domain name with different ports? ID I want to add a new port the app shows that the domain is already in use.
Author
Owner

@Wadera commented on GitHub (Sep 3, 2019):

Anyone know how to allow access to the network only from internal network?

I've tried something like:

location / {
    allow 192.168.0.1/15;
    allow 172.0.0.1/8;
    deny all;
}

Where 172.0.0.1/8 is my Docker subnet (including OpenVPN), 192.168.0.1/15 is for my local behind NAT networks for home PC, Netbooks etc. Unfortunately - when I apply this config - I've got: 404 Not Found error :(

<!-- gh-comment-id:527389915 --> @Wadera commented on GitHub (Sep 3, 2019): Anyone know how to allow access to the network only from internal network? I've tried something like: ``` location / { allow 192.168.0.1/15; allow 172.0.0.1/8; deny all; } ``` Where `172.0.0.1/8` is my Docker subnet (including OpenVPN), `192.168.0.1/15` is for my local behind NAT networks for home PC, Netbooks etc. Unfortunately - when I apply this config - I've got: `404 Not Found` error :(
Author
Owner

@Wadera commented on GitHub (Sep 3, 2019):

For any interested. I've just dropped header and footer.

My current Custom Nginx Configuration in Advanced tab is:

allow 88.99.123.123;
allow 192.168.0.1/15;
allow 172.0.0.1/8;
deny all;

where 88.99.123.123 is my external IP address.

This solve my issue. Host is accessible only from local / VPN network.

<!-- gh-comment-id:527418610 --> @Wadera commented on GitHub (Sep 3, 2019): For any interested. I've just dropped header and footer. My current **Custom Nginx Configuration** in Advanced tab is: ``` allow 88.99.123.123; allow 192.168.0.1/15; allow 172.0.0.1/8; deny all; ``` where `88.99.123.123` is my external IP address. This solve my issue. Host is accessible only from local / VPN network.
Author
Owner

@aymenSo commented on GitHub (Feb 17, 2020):

Anyone was able o configure seafile server over nginx-proxy-manager?
nginx configuration for seafile is in the following link:
https://seafile.readthedocs.io/en/latest/config/nginx/
I am trying without success!

<!-- gh-comment-id:587052121 --> @aymenSo commented on GitHub (Feb 17, 2020): Anyone was able o configure seafile server over nginx-proxy-manager? nginx configuration for seafile is in the following link: https://seafile.readthedocs.io/en/latest/config/nginx/ I am trying without success!
Author
Owner

@geoffrothman commented on GitHub (Jan 20, 2021):

For any interested. I've just dropped header and footer.

My current Custom Nginx Configuration in Advanced tab is:

allow 88.99.123.123
allow 192.168.0.1/15;
allow 172.0.0.1/8;
deny all;

where 88.99.123.123 is my external IP address.

This solve my issue. Host is accessible only from local / VPN network.

I'm assuming you had a semicolon at the end of the first line right?

<!-- gh-comment-id:763330017 --> @geoffrothman commented on GitHub (Jan 20, 2021): > For any interested. I've just dropped header and footer. > > My current **Custom Nginx Configuration** in Advanced tab is: > > ``` > allow 88.99.123.123 > allow 192.168.0.1/15; > allow 172.0.0.1/8; > deny all; > ``` > > where `88.99.123.123` is my external IP address. > > This solve my issue. Host is accessible only from local / VPN network. I'm assuming you had a semicolon at the end of the first line right?
Author
Owner

@Wadera commented on GitHub (Jan 20, 2021):

Correct - fixed on comment ;)

<!-- gh-comment-id:763635349 --> @Wadera commented on GitHub (Jan 20, 2021): Correct - fixed on comment ;)
Author
Owner

@chaptergy commented on GitHub (May 10, 2021):

This issue has gone a little off the rails. I'll close this for now. If you have a specific question, please open a separate issue for this.

<!-- gh-comment-id:837473730 --> @chaptergy commented on GitHub (May 10, 2021): This issue has gone a little off the rails. I'll close this for now. If you have a specific question, please open a separate issue for this.
Author
Owner

@SteveGBuck commented on GitHub (Jun 10, 2021):

Sorry to highjack this thread but, I have a similar question.

I am trying to have nxgin do a Rewrite of the URL every time.

the problem is one of my site behind the reverse proxy is set for'
(http://example.com:8080/) & (https://example.com:8443/). it's an unifi controller and I can change the port to 80 and 443 without the service failing. so I just forwarded 8443 and 8080 to 80 and 443 but I really need it to perform a Rewrite as well every time to fix the issue.

So I need nxgin to change the http://example.com:8080 & https://example.com:8443/) to just https://example.com.

Any help would be great.

Did you solve this? I too am setting up unifi controller in Docker behind NPM proxy and unsure how I might have all the required ports handled by the proxy.

I have a proxy host setup in NPM:

unifi.mydomain.com > https://container_name:8443

This works great for the web interface (because I can force SSL end to end there's no issue with the login error).

But I also need to redirect the following ports to the container too:

8080/tcp - Device command/control

8880/tcp - HTTP portal

3478/udp - STUN service

6789/tcp - Speed Test (unifi5 only)

I could just map the ports to the docker host instead of just expose. Or maybe use "streams" in NPM but this uses IP address only which could change on my container.

<!-- gh-comment-id:858630404 --> @SteveGBuck commented on GitHub (Jun 10, 2021): > Sorry to highjack this thread but, I have a similar question. > > I am trying to have nxgin do a Rewrite of the URL every time. > > the problem is one of my site behind the reverse proxy is set for' > (http://example.com:8080/) & (https://example.com:8443/). it's an unifi controller and I can change the port to 80 and 443 without the service failing. so I just forwarded 8443 and 8080 to 80 and 443 but I really need it to perform a Rewrite as well every time to fix the issue. > > So I need nxgin to change the http://example.com:8080 & https://example.com:8443/) to just https://example.com. > > Any help would be great. Did you solve this? I too am setting up unifi controller in Docker behind NPM proxy and unsure how I might have all the required ports handled by the proxy. I have a proxy host setup in NPM: unifi.mydomain.com > https://container_name:8443 This works great for the web interface (because I can force SSL end to end there's no issue with the login error). But I also need to redirect the following ports to the container too: 8080/tcp - Device command/control 8880/tcp - HTTP portal 3478/udp - STUN service 6789/tcp - Speed Test (unifi5 only) I could just map the ports to the docker host instead of just expose. Or maybe use "streams" in NPM but this uses IP address only which could change on my container.
Author
Owner

@gaozhidf commented on GitHub (Dec 17, 2021):

nginx-proxy-manager uses Custom Nginx Configuration as advanced_config in proxy_host.conf template,
ref: github.com/jc21/nginx-proxy-manager@e91019feb9/backend/templates/proxy_host.conf

<!-- gh-comment-id:996573084 --> @gaozhidf commented on GitHub (Dec 17, 2021): nginx-proxy-manager uses `Custom Nginx Configuration` as `advanced_config ` in `proxy_host.conf` template, ref: https://github.com/jc21/nginx-proxy-manager/blob/e91019feb91ca29187dbc106b96d5becda5679b1/backend/templates/proxy_host.conf
Author
Owner

@marlonleite commented on GitHub (Sep 20, 2023):

hi, Does anyone know how to change the return ssl conf to port 308?
When I try to use nginx with ssl to APIs, POST redirect to GET. :/

<!-- gh-comment-id:1727525632 --> @marlonleite commented on GitHub (Sep 20, 2023): hi, Does anyone know how to change the return ssl conf to port 308? When I try to use nginx with ssl to APIs, POST redirect to GET. :/
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#153
No description provided.