0

I have 2 deployments on a kubernetes VPS. They are exposed via NodePort service.

I have nginx installed and I'm trying to reverse proxy requests to these deployments in a way that for example "server.com" goes to the first deployment and "server.com/suburl" goes to the second deployment. I've tried something similar to this from a website:

server {
listen       ...;
...
location / {
    proxy_pass http://127.0.0.1:8080;
}

location /blog {
    proxy_pass http://127.0.0.1:8181;
}

location /mail {
    proxy_pass http://127.0.0.1:8282;
}
...
}  

It's not working.

When i open the / location it brings me to the main website page, but when I open any of the sub URLs it doesn't open anything and shows white page with no text. The url on top appears to redirect to / and if I refresh it will open the main website.

Any ideas on how to fix it or better way of doing it?

2
  • 1
    You need to give much more information if you want help. Show your full configuration, show a curl and the matching access / error logs, etc.
    – Tim
    Aug 11, 2018 at 7:50
  • check here for hints serverfault.com/a/650182/442275 Aug 11, 2018 at 18:01

1 Answer 1

0

we did a bit more debugging and realized that aside from nginx the websites were not routing traffic correctly
since both are developed with angular if routing fails they will be redirected to base url

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .