I have a flask app running in a docker container, and I configured nginx to redirect all requests to this container. Here's my nginx config:
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
proxy_read_timeout 60s;
}
}
On the frontpage I have a link to a subdirectory <a href="/sub/dir/">Test</a>
, and when the page renders I can see it links to http://example.com/sub/dir
. However when I click onto it browser shows http://127.0.0.1:5000/sub/dir
and tries to reach my local.