Comments (10)
Yep it's certainly a possible improvement. I've found myself wanting this in one scenario before as well. Just need to be careful when the upstream server is another http proxy that expects the destination hostname to be supplied and that might be different from the source hostname. Some testing scenarios would need to be considered.
In the meantime, if you want to hack things right now to get moving, find the specific nginx conf file in your data directory for the host you've set up, edit it and look at the location / {
block. There will be a line that is:
include conf.d/include/proxy.conf;
Replace that line with the following:
add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass https://$server:$port;
Save the file, then restart the docker container and it will pick up those changes. However, if you make changes to that proxy host inside Nginx Proxy Manager interface, it will overwrite your custom changes, so be careful there.
from nginx-proxy-manager.
Yeah so I was more thinking the following scenario:
Edge proxy running NPM Internal https server
https://myserver.com => https://otherserver.com
NPM will resolve and find otherserver.com
via dns, but when it hits that upstream web server in this scenario, the server is running multiple SSL sites on the same web server and differentiating them by the hostname (SNI).
With the workaround code above, when you hit https://myserver.com
in your browser, it will send through the Host
header as myserver.com
to the upstream server when in fact it is expecting otherserver.com
to be the host header value. While that is easy to code for in this application by changing the Host
header to the upstream server name, it introduces a new problem where the upstream web application might be using fixed URLs in it's content instead of relative ones. So, you request https://myserver.com
, the HTML returned has a link to https://otherserver.com
because it doesn't know it's behind a reverse proxy.
- Nginx can rewrite the html response before returning it to the user to replace these paths using LUA scripts, but I don't feel that brave yet..
- Not sure how common this is going to be, so I'm not going to code for it yet. Just going to get the minimal viable product working for your particular problem
from nginx-proxy-manager.
include conf.d/include/proxy.conf;
Replace that line with the following:
add_header X-Served-By $host; proxy_set_header Host $host; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass https://$server:$port;
Thanks for this workarround.
What needs to be tested? Maybe I can help here! About https://
I can say It works for IP address proxyed servers on SSL enabled ports with the workarround. I'll try to proxy to a named server but It should work while the proxy can resolve the DNS. I think this should not be related to the protocol anyway.
Thanks,
Aitor.
from nginx-proxy-manager.
I've pushed this https upstream proxy support to the jc21/nginx-proxy-manager:develop
docker tag. Give it a try and see if it does what you need.
from nginx-proxy-manager.
Hi!
First of all, thanks for the great explaination, you're totally right.
I've tested the dev branch and worked as expected with no vhosts on real servers, or when you're asking for a domain the real server can handle with root or vhost. I can see some issues when you're asking for a domain the real server don't know and you're forwarding to an IP address, but i should test this a bit more.
After all the HTTPS proxy hosts are working. Thanks!
Aitor.
from nginx-proxy-manager.
Perfect. just wanted to open a feature request and then I came across this one. works perfectly, thanks a lot !
from nginx-proxy-manager.
HTTPs upstream proxy support is a really good feature that covers a common scenario. Thanks! I hope this will be merged in an official release.
from nginx-proxy-manager.
Looking forward to this feature as well!
from nginx-proxy-manager.
Added in v2.0.7
from nginx-proxy-manager.
Thank you very much!
from nginx-proxy-manager.
Related Issues (20)
- NPM gui on port 81 doesnt work HOT 2
- Ability to live-view logs for hosts HOT 2
- Aprove/merge my pr for "Portuguese Documentation Translation" please 🥲🥺
- username and password forget HOT 1
- Feature Request - API Endpoint For Retrieving Generated TLS Certificates
- Allow closing popups/dialogs with Escape key
- No module named certbot HOT 2
- NPM passes through some requests even though 444 option is set HOT 2
- Enable ngx_stream_realip_module by default
- Login Credentials
- Proxy-Host creation via cli or api
- need huaweicloud DNS
- Using service names in docker swarm HOT 1
- [SECURITY] Possible Security Vuln HOT 3
- NPM template, or at mimimum copy a configuration
- Make "NPM automatically create custom DNS with pihole" an option.
- Internal error (to do with NodeJS?) when trying to make an SSL certificate HOT 3
- Can't create or renew certs because of SSLError(SSLError(1, '[SSL: TLSV1_UNRECOGNIZED_NAME] tlsv1 unrecognized name (_ssl.c:992)')). HOT 1
- Internal Error: josepy.errors.DeserializationError: Deserialization error: Expecting value: line 1 column 1 (char 0) HOT 1
- Response Header from /subfolder are wrong or missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-proxy-manager.