0

I've been trying to set up a reverse proxy for another docker container and nothing I do can get it to work anymore. No matter what I do I can no longer get https to respond at all.

Sabnzbd works via http://192.168.1.157:8080 and https://192.168.1.157:8081.

Here are all my configs

docker-compose.yml

version: '2' 
services:
  nginx:
    image: nginx:latest
    container_name: nginx
    volumes:
       - /data/config/certbot/conf:/etc/letsencrypt
       - /data/config/certbot/www:/var/www/certbot
       - /data/config/nginx:/etc/nginx
    ports:
       - 80:80
       - 443:433
    env_file: uidgid.env
    restart: always
    command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
  certbot:
    image: certbot/certbot
    container_name: certbot
    env_file: uidgid.env
    volumes:
       - /data/config/certbot/conf:/etc/letsencrypt
       - /data/config/certbot/www:/var/www/certbot
    restart: always
    entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
  sabnzbd:
    image: linuxserver/sabnzbd:latest
    container_name: sabnzbd
    volumes:
        - /data/config/certbot:/etc/letsencrypt
        - /data/config/sabnzbd:/config
        - complete:/complete
        - incomplete:/incomplete
        - Shows:/shows
        - Movies:/movies
        - 4K:/4K
    ports:
        - 8080:8080
        - 8081:8081
    env_file: uidgid.env
    environment:
        - EDGE=1
        - VIRTUAL_HOST=mydomain.com/sabnzbd
        - VIRTUAL_PORT=8081
    restart: always

Nginx configs:

#nginx.conf
events{} 
http {
    server {
        listen 443 ssl;
        server_name mydomain.com;

        include /etc/nginx/common.conf;
        include /etc/nginx/ssl.conf;

        location /sabnzbd {
            proxy_pass https://192.168.1.157:8081;
            include /etc/nginx/common_location.conf;
        }
    }
}


#ssl.conf
ssl_dhparam                 /etc/letsencrypt/ssl-dhparams.pem;
ssl_certificate             /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key         /etc/letsencrypt/live/mydomain.com/privkey.pem;
ssl_session_timeout         10m;
ssl_session_cache           shared:SSL:10m;
ssl_session_tickets         off;

#common.conf
add_header Strict-Transport-Security    "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options              SAMEORIGIN;
add_header X-Content-Type-Options       nosniff;
add_header X-XSS-Protection             "1; mode=block";


#common_location.conf
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   $scheme;
proxy_set_header    Host                $host;
proxy_set_header    X-Forwarded-Host    $host;
proxy_set_header    X-Forwarded-Port    $server_port;

Netstat shows 443 is listening.

netstat -lpn |grep :443
    tcp6       0      0 :::443                  :::*                    LISTEN      12129/docker-proxy

Firewall is disabled.

ufw status 
    Status: inactive 

Iptables not enabled

service iptables status 
    Unit iptables.service could not be found. 

Curl shows connection refused

curl https://192.168.1.157/sabnzbd/ 
    curl: (7) Failed to connect to 192.168.1.157 port 443: Connection refused

Other Curl command:

curl https://127.0.0.1/sabnzbd/ 
    curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:443

If there's anything else you want to see let me know. Thanks.

  • What does your nginx error log says ? – Zeitounator Jun 8 at 12:48
  • Nothing. No entry logged. – Patman Jun 8 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.