0

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)

1 Answers1

0

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

Sinauwae
  • 23
  • 6