currently trying to proxy to another port to serve up a shiny app. Followed this tutorial and adapted to return based on nginx documentation recommendations. It works..
location /shiny/ {
rewrite ^/shiny/(.*)$ /$1 break;
proxy_pass http://localhost:3838;
proxy_redirect / $scheme://$remote_addr/shiny/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $remote_addr;
proxy_read_timeout 20d;
proxy_buffering off;
return 301 $scheme://$remote_addr/shiny/;
}
but if I try for a more complex path like below, it falls apart. What am I missing? I've tried making sure my regex works and it appears to.
location /services/1234/service/shiny/ {
rewrite ^/services/1234/service/shiny/(.*)$ /$1 break;
proxy_pass http://localhost:3838;
proxy_redirect / $scheme://$remote_addr/services/1234/service/shiny/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $remote_addr;
proxy_read_timeout 20d;
proxy_buffering off;
return 301 $scheme://$remote_addr/services/1234/service/shiny/;
}