0

I have the following nginx configuration for vhost:

server {          
        listen 80;
        server_name guest8.ellak.gr;

        location /.well-known/acme-challenge {
            root /var/www/letsencrypt;
        }

    location / {
        rewrite ^ https://$server_name$request_uri? permanent;
    }
} 

server {

    listen 443 ssl; 

    #Change theese ones
        ssl_certificate     /etc/letsencrypt/live/guest8.ellak.gr/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/guest8.ellak.gr/privkey.pem;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;
    server_name guest8.ellak.gr;

    #To have one site for all piwik analytics
    location /piwik/ {
        error_page 502 /502.html;

        proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            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_cache_bypass $http_upgrade;

            proxy_pass http://0.0.0.0:8081;
                proxy_set_header Host guest8.ellak.org;
    }

    location /mailcow/ {
            error_page 502 /502.html;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                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_cache_bypass $http_upgrade;

                proxy_pass http://0.0.0.0:8099;
                proxy_set_header Host guest8.ellak.org;
    }

    location = /502.html{
        root /var/www/ellak.org;
    }   
}

What I want to achieve it to host various docker apps under a alias + using ssl. But either visiting http://guest8.ellak.gr/piwik or http://guest8.ellak.org/mailcow I get error 404.

Can you help me to figure out why?

Dimitrios Desyllas
  • 523
  • 2
  • 10
  • 27
  • Please add a couple of access / error log entries that show what's going on. If applicable you might like to look at the logs of the server being proxied to. Of course 0.0.0.0 is not a valid IP for a server, I assume that's obfuscation. – Tim Jun 14 '17 at 19:42
  • I sue them for docker images. Docker images may not have a static ip dy default. – Dimitrios Desyllas Jun 14 '17 at 19:45
  • You "sue" 0.0.0.0 for docker? Don't. Also, please read the rest of my comment and provide information to help diagnose the problem. – Tim Jun 14 '17 at 19:46

0 Answers0