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

232
Views
How to reverse proxy app in a subdirectory?

I'd like to reverse proxy my application under server.com/myapp/homem where server.com/myapp is the proxied address and /home is an URL handled by my app.

What is the best / recommended solution to do that so that the app will generate proper paths<img src="/myapp/static/...">

Which of the two following approaches I should take: 1. X-Forwarded-Path: I proxy GET Path=/home and add an X-Forwarded-Path: /myapp 2. Base_url set in config: I proxy GET Path=/myapp/home and set base_url = server.com/myapp

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The nginx rewrite directive can handle what you are looking for

You server block should look similar to the following snippet

server {
    listen 80;

    rewrite ^/myapp/(.*)$ /$1 last;

    location /home {
        proxy_set_header X-Forwarded-Path myapp;
        proxy_pass http://1.2.3.4;
    }
}

Take a look at either of the following for more information

  • https://www.nginx.com/blog/creating-nginx-rewrite-rules/
  • http://nginx.org/en/docs/http/ngx_http_rewrite_module.html
over 4 years ago · Santiago Trujillo Report
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!