SWAG custom subfolder variables not working

Hi,

Iam trying to setup THIS container behind the SWAG with a custom subfolder proxyconf. This is the conf:

location = /firefox {return 301 $scheme://$http_host/firefox/;}
location ^~ /firefox/ {
	auth_basic "Restricted Area";
	auth_basic_user_file /config/nginx/.htpasswd;
    set $upstream_app firefox;
    set $upstream_port 5800;
    set $upstream_proto http;
	proxy_pass $upstream_proto://$upstream_app:$upstream_port/;
	location /firefox/websockify {
    set $upstream_app firefox;
    set $upstream_port 5800;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port/websockify/;
	proxy_http_version 1.1;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection $connection_upgrade;
	proxy_read_timeout 86400;
	}
}

When using the variables like $upstream_proto etc it is not working but when Iam using
proxy_pass http://firefox:5800/; its working fine.
Any Ideas?