0

I have following nginx reverse proxy configuration:

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /application {
        proxy_pass https://my.url:9443/application;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /dashboard {
        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

my location "/" got proxied to my npm dev server, which is working great.

my location "/aplication" got proxied to my application I publish, which is working great, too!

so why does my location "/dashboard" does not work, when proxied to my other npm dev server, which listens on port 3001? What makes my concerns even stronger is the fact, that when I change the port from my default location "/" to 3001, my react app is getting accessed.

my output from sudo netstat -lntp:

tcp 0 0 0.0.0.0:3001 0.0.0.0:* LISTEN 3677/node

y.y
  • 308
  • 4
  • 16
  • Accordingly of Nginx documentation: "If proxy_pass is specified without a URI, the request URI is passed to the server in the same form as sent by a client when the original request is processed". Is your application ready to processing the request URI /dashboard ? – Aleksey Vaganov Feb 02 '23 at 19:22
  • No it is not. I just want to have my request from domain/dashboard proxied to "localhost:3001", thats all In nginx error.log this request gets routed to "localhost:3001/dashboard" – y.y Feb 03 '23 at 08:52

0 Answers0