'Why is my service throwing a 404 when trying to proxy with NGINX but I can reach it in a shell?

I have the following on my NGINX server...

server {
 listen 443 ssl;
 server_name localhost;
 ssl_certificate     /usr/src/app/host.crt;
 ssl_certificate_key /usr/src/app/host.key;
 ...
 location /core {
    proxy_pass http://auth-example-application-core-1:3000;
 }
}

But when I try to access https://localhost/core I get a 404. If I open a shell and access the NGINX container itself I can hit the endpoint and get a response....

curl http://auth-example-application-core-1:3000
{"status":200,"message":"...","hostname":"5f5444c40d5b"}#

So why is it throwing a 404?

I Also tried...

location /core {
  rewrite /core/(.*) /$1   break;
  proxy_pass http://auth-example-application-core-1:3000;
}

That didn't seem to work either



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source