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 OK
Server: nginx
Date: Tue, 05 Mar 2019 13:33:42 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 31 Jan 2017 15:01:11 GMT
Connection: keep-alive
ETag: "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!