We have an nginx server that we're using as a reverse proxy. We redirect every HTTP traffic to HTTPS, except a specific path - /success.html. The mechanism works at first, but after a while (few hours / days), the /success.html location stops working and times out. The other location (/) keeps working well. After reloading the nginx, things return to normal (until next time...).
Our conf file:
server {
listen 80;
server_name mypublicdomain.com;
location /success.html {
proxy_pass http://myinternaldomain.net/success.html;
}
location / {
return 301 https://mypublicdomain.com$request_uri;
}
}
server {
listen 443 ssl http2;
server_name mypublicdomain.com;
...
...
}
What are we doing wrong here? We've seen similar issues when putting more than one location on the same server (with one location being more specific that the other).