1

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).

Thomas
  • 4,155
  • 5
  • 21
  • 28
nozik
  • 31
  • 3
  • Is there an error log entry? Does the `proxy_pass` time out? Is it possible that the `myinternaldomain.net` IP address is changing? – Richard Smith Jul 29 '18 at 08:48
  • Thanks @RichardSmith, seems like the issue was indeed the changing IP address. What we did was add a `resolver`, and put `myinternaldomain.net` as a variable. – nozik Jul 30 '18 at 17:29

0 Answers0