0

I have this config

server {
  listen 8080;
  access_log  /var/log/nginx/access.log;
  root        /usr/share/nginx/htdocs;
  index       index.html index.htm;
  port_in_redirect off;

  location /somepath/ {
      proxy_pass http://someinternalserver/somepath/;
  }

  location /health {
    return 200;
  }
}

When I access it like this, http://our-external-fqdn/somepath/ it works.

However, when I access it like this, http://our-external-fqdn/somepath/# I get redirected to our local development setup which is http://localhost:8000

What am I missing?

1 Answers1

0

You've specified an exact URL not a regular expression. Try this

location ~* /somepath/ {
  proxy_pass http://someinternalserver/somepath/;
}

If that doesn't work please curl (with show headers, option is -D I think) the URL to see what's going on, or use Firefox with "Live HTTP Headers". Post the output for that request along with your access logs.

Tim
  • 33,870
  • 7
  • 56
  • 84