nginx proxy pass: trailing slash, vars don't work

Viewed 162

I can't wrap my head around how this is not the same:

  1. does not work
    set $upstream_app myapp;
    set $upstream_port 1234;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port/;
  1. does work

    proxy_pass http://myapp:1234/;

I suppose it must have to do with the trailing slash. Even when I add the trailing slash to the var, it does not work. In fact, if I only replace one part of the uri it already breaks.

Anybody got an idea? Thanks in advance!

Edit: I have a resolver in place. resolver 127.0.0.11 valid=30s;

0 Answers
Related