Dear friends,
I'll go straight to the point. This is my nginx.conf:
set $upstream_portainer "http://my_portainer-service:9000";
location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;
proxy_set_header Connection "";
proxy_buffers 32 4k;
#proxy_pass http://my_portainer-service:9000/; # --> this WORKS
#proxy_pass $upstream_portainer/; # --> this does NOT work
proxy_pass ${upstream_portainer}/; # --> this does NOT work
}
Why doesn't it work with the alias? I'm sure I have seen it used many times, especially in conunction with Docker service names, so that they'd be reevaluated periodically rather than just at startup of NGINX.
Thank you so much,
Best regards,
Roberto
I'll go straight to the point. This is my nginx.conf:
set $upstream_portainer "http://my_portainer-service:9000";
location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;
proxy_set_header Connection "";
proxy_buffers 32 4k;
#proxy_pass http://my_portainer-service:9000/; # --> this WORKS
#proxy_pass $upstream_portainer/; # --> this does NOT work
proxy_pass ${upstream_portainer}/; # --> this does NOT work
}
Why doesn't it work with the alias? I'm sure I have seen it used many times, especially in conunction with Docker service names, so that they'd be reevaluated periodically rather than just at startup of NGINX.
Thank you so much,
Best regards,
Roberto