Score:0

nginx location proxy pass to another port path

us flag

I have two docker containers running for react (http://localhost:90) and nextjs (my-next-app.com / http://localhost:85) applications, and I have Nginx configuration similar to the following

    server {
    listen 443 ssl http2;
    ssl on;
    ssl_certificate /foo.crt;
    ssl_certificate_key /foo.key;
    server_name www.my-next-app.com my-next-app.com;

    location / {
        ...
        proxy_pass http://localhost:85;
    }
   }

And what I was trying to do when I hit this www.my-next-app.com/faq, I want the user to see the faq page of my react app instead (http://localhost:90/faq)

    server {
    listen 443 ssl http2;
    ssl on;
    ssl_certificate /foo.crt;
    ssl_certificate_key /foo.key;
    server_name www.my-next-app.com my-next-app.com;

    location / {
        ...
        proxy_pass http://localhost:85;
    }

    location /faq {
        ...
        proxy_pass http://localhost:90/faq/;
    }
  }

I tried the above configuration but it didn't work, I just want to know whether this is something possible to do, And also some guidance would be much appreciated. I got following output on the browser console

Uncaught SyntaxError: Unexpected token '<' (at main~eec90089.js:1:1)
Score:0
ae flag

try to place the proxy_pass for /faq/ above the proxy_passs for /

Githendra McShane avatar
us flag
thank you for the suggestion. but it didn't work
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.