Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
rewrite a complex path for reverse proxy

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/;
    }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!