Reverse Proxy to Docker Container (on another host)
May 15, 2020 07:17PM
I have a reverse proxy setup that I know works fine. Already SSL, good cert, whole shindig. On another host, I have a webserver (Ombi) that I want to run the alpha for, which is only available in a docker image. I can access the webserver just fine without the reverse proxy, but I need to be able to use SSL (not available for the webserver currently) and not take up public IPs. When I try to connect example.com/test, I get nothing but the Title element (Tab renamed) and a blank white screen. Do I need to change something with docker's DNS or something in my proxy config to allow this to work?


server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

root /var/www/example.com;

index index.html index.htm index.nginx-debian.html;

server_name example.com;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

location /test {
proxy_pass http://1.1.1.2:3579;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 90;
proxy_redirect http://1.1.1.2:3579 https://$host;
}

ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready