Creating proxy for nginx-proxy-manager admin interface
Hi, Awesome piece of software, very useful, thank you very much for publishing it.
I am trying to create a proxy for the admin interface on port ~91~ 81. Here is what I have: Domain name: proxy.mydomain.de (real domain name here) scheme: https Forward host/port: 127.0.0.1:81 SSL certificate: proxy.mydomain.de Force SSL
It shows status "Online", but when I access proxy.mydomain.de, I get a 502 Bad Gateway.
What am I doing wrong?
Can you make sure the service on port 81 is running?
Yes, it is, I am trying to use it to proxy itself...
My bad. nginx-proxy-manager serves http traffic only. when I switched to http, it worked. Closing.
Can we put the admin interface behind a path? Like: domain.com/npm ? I'm trying it but it won't work. Can't find any info about it.
nope, npm run only un root of URL host
nope, npm run only un root of URL host
This kind of an old issue, but actually it is possible to hide admin panel behind the sub path: https://wiki.sitnikov.eu/doku.php?id=howto:npm#final_npm_configuration
Add 2 locations:

From now there are 2 Options. Even if you combine them, you will not harm anything in NPM:
Option 1
And add Advanced rule:
location ~ ^/(css|js|images|login|assets|nginx|users|audit-log|settings) {
return 307 https://$http_host/npm$request_uri?$args;
}
Replace npm with whatever you need in Custom Location and Advanced config.
Now you can control TLS configuration for NPM Admin Panel as for #481, #182
Option 2
UPDATE: Option 2 solutions only, you DO NOT NEED TO ADD API endpoint as above in a screenshot.
In "Custom Location" click on "Options" for /npm/ and add there rewrite content rules, so at the end it looks similar to:
### Paste here Rewrite content
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types text/html application/javascript text/css;
sub_filter '/css' '/npm/css';
sub_filter '/js/' '/npm/js/';
sub_filter '"js/"' '"npm/js/"';
sub_filter '/images' '/npm/images';
sub_filter '/assets' '/npm/assets';
sub_filter '/api' '/npm/api';
sub_filter '/login' '/npm/login';
Also this will be Apache2 Configuration:
Redirect 301 "/npm" "/npm/"
<Location /npm>
ProxyPreserveHost On
ProxyPass http://localhost:81/ retry=0 connectiontimeout=5 timeout=30 keepalive=on
ProxyPassReverse http://localhost:81/
RequestHeader set Connection ""
AddOutputFilterByType INFLATE;SUBSTITUTE text/html application/javascript text/css
Substitute "s|/css/|/npm/css/|inq"
Substitute "s|/js/|/npm/js/|inq"
Substitute "s|\"js/\"|\"npm/js/\"|inq"
Substitute "s|/images|/npm/images|inq"
Substitute "s|/assets|/npm/assets|inq"
Substitute "s|/api|/npm/api|inq"
Substitute "s|/login|/npm/login|inq"
</Location>