I have an nginx which should proxy the path domain.de/pihole/* to a docker container running pihole. If I use the IP of the docker dontainer (172.20.0.2) the index.php is loaded, 172.20.0.2/admin and 172.20.0.2/admin/index.php work as well. If I use domain.de/pihole or domain.de/pihole/admin, I get a 404. If I use domain.de/pihole/admin/index.php, all is working. This is my /etc/nginx/sites-available/default:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
#proxy_pass http://172.20.0.2:25565;
}
location /pihole/ {
proxy_pass http://172.20.0.2:80/;
proxy_http_version 1.1;
proxy_set_header Host $host:$server_port;
proxy_set_header Referer $http_referer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header X-Client-Verify $ssl_client_verify;
proxy_set_header X-Client-DN $ssl_client_s_dn;
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}
}
Any ideas what I have to change (I copied most of the "proxy_set_header" stuff from serverfault)?