خرید بک لینک

Vote count: 0

I am trying to set up an Nginx reverse proxy server which will perform https termination for multiple docker containers one of them being the Rancher server. My wish is to set up the reverse proxy server as following:

https://<server>/rancher -> rancher-server
https://<server>/jenkins -> jenkins-master
...

I succeeded in setting up the rancher server at https://<server> by following the documentation at Installing Rancher Server With SSL. As mentioned in the document, my nginx configuration is as following:

upstream rancher {
    server rancher-server:8080;
}

server {
    listen 443 ssl;
    server_name <server>;
    ssl_certificate <cert_file>;
    ssl_certificate_key <key_file>;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Port $server_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://rancher;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Coection "upgrade";
        # This allows the ability for the execute shell window to remain open for up to 15 minutes. Without this parameter, the default is 1 minute and will automatically close.
        proxy_read_timeout 900s;
    }
}

server {
    listen 80;
    server_name <server>;
    retu 301 https://$server_name$request_uri;
}

When I change the location from / to /rancher, Rancher server does not work correctly anymore. When accessing https://<server>/rancher, Rancher indicates error 404.

How can I set up the nginx to make the rancher server accessible at https://<server>/rancher?

asked 34 secs ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 11 مرداد 1395 ساعت: 0:29

صفحه بندی