Custom Location fails on second, third,...
See original GitHub issueGreat project, nice interface and function, thank you!
I have a single proxy host domain configured with two custom locations, aka /path(s). The first path works/is redirected as expected. The second, third, … return a 404. I’ve included my docker-compose.yml, ./data/nginx/proxy_host/1.conf snippet, and screenshots.
I’m not sure what it is I might be missing in the configuration or if indeed it’s a bug. I’m a little unclear on the Use 1.1.1.1/path for sub-folder forwarding
statement under the /path field. Obviously your wouldn’t use 1.1.1.1, or other DNS. I tried using the subdomain.domain.com but that failed as I would have expected since it would create a loop. I’m also a little confused on the destination port setting of the proxy host since I’m redirecting using a custom location/path. No port setting I’ve tried resolves the issue and no port is not an option as it’s required.
Thank you
Checklist
- Have you pulled and found the error with
jc21/nginx-proxy-manager:latest
docker image? YES
version: "3"
services:
app:
image: jc21/nginx-proxy-manager:latest
restart: always
ports:
# Public HTTP Port:
- '80:80'
# Public HTTPS Port:
- '443:443'
# Admin Web Port:
- '81:81'
environment:
# Uncomment this if IPv6 is not enabled on your host
DISABLE_IPV6: 'true'
volumes:
# Make sure this config.json file exists as per instructions above:
- ${USERDIR}/nginx_proxy_manager/config.json:/app/config/production.json
- ${USERDIR}/nginx_proxy_manager/data:/data
- ${USERDIR}/nginx_proxy_manager/letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: <obfuscated>
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'ngx_user'
MYSQL_PASSWORD: <obfuscated>
volumes:
- ${USERDIR}/nginx_proxy_manager/data/mysql:/var/lib/mysql
-
Are you sure you’re not using someone else’s docker image? YES
-
If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network?
Describe the bug The first custom location works as expected. The second, third, … fail with a 404
- What version of Nginx Proxy Manager is reported on the login page? 2.7.1
To Reproduce Steps to reproduce the behavior:
- Enter a custom location for a domain
- Navigate to the “custom location” aka /path in my browser’s address bar
- See the 404 error
Expected behavior
- After creating the Custom Location navigating to custom location, aka /path and have page displayed
Screenshots
snippet from ./data/nginx/proxy_host/1.conf
#...
location /smokeping {
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 http://10.10.0.173:9001;
}
location /dockerui {
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 http://10.10.0.173:9000;
}
#...
Operating System Ubuntu 20.04.1 Docker version 19.03.13, build 4484c46d9d docker-compose version 1.27.4 HP Elite 8300 i5-3470S, 16GB Ram, 1TB SSD
./data/logs/proxy_host-1.log
[05/Dec/2020:20:17:33 +0000] - 404 404 - GET https <obfuscated>.com "/dockerui" [Client 10.10.0.1] [Length 19] [Gzip -] [Sent-to 10.10.0.173] "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36" "-"
No relative info from
data/logs/error.log
data/logs/default_host.log
data/logs/default.log
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top GitHub Comments
@federicoalvarez-github What works is
Edit proxy host -> Advanced -> Custom Nginx Configuration
adding the above mentioned code to the advanced tab added this towards the top of my config file above all my other custom locations
location /portainer/ {
rewrite /portainer/(.*) /$1 break;
proxy_pass https://192.168.1.6:9443;
}
From custom locations ui set the path as
/portainer/
and fill in the rest like you normally would. then click the gear icon and in the custom section addrewrite /portainer/(.*) /$1 break;
.that might do the trick without needing to use the advanced tab and should add the same thing to your config as listed above but I have not tested this yet.
(I did not use the
location / { # Proxy! include conf.d/include/proxy.conf
line as I already had that location block in my config file.)