Nginx: What is causing this 301 redirect? Nginx: What is causing this 301 redirect? nginx nginx

Nginx: What is causing this 301 redirect?


I'm still not sure how to fix this completely, but when I take out

return 301 https://$server_name$request_uri;

and run curl -I -L http://www.myapp.com/ I get

HTTP/1.1 200 OKServer: nginxDate: Tue, 05 Mar 2019 13:33:42 GMTContent-Type: text/htmlContent-Length: 612Last-Modified: Tue, 31 Jan 2017 15:01:11 GMTConnection: keep-aliveETag: "5890a6b7-264"Accept-Ranges: bytes

But I can't access the page because obviously LetsEncrypt is redirecting all http to https so I get referred back to the 301 error page!