<html><head></head><body><div class="ydp1a37a54cyahoo-style-wrap" style="font-family: Helvetica, Arial, sans-serif; font-size: 16px;">Hello,<br><div><br><div>I'd like to be able to offer let's encrypt in port 80 only and redirect everything else to port 443<br><div><br><span>server {<br> listen 80;<br> listen [::]:80;<br> listen 443;<br> listen [::]:443;<br> server_name <a href="http://www.mydomain.org" rel="nofollow" target="_blank">http://www.mydomain.org</a> blog.<span><span>mydomain.org</span></span>;<br> location ^~ /.well-known/acme-challenge { default_type "text/plain"; root /var/www/letsencrypt; }<br> location = /.well-known/acme-challenge/ { return 404; }<br> return 301 https:// <span><span>mydomain.org</span></span>;<br>}<br><br></span><div>My problem is that everything is redirected and I cannot access a file in <span><span>/var/www/letsencrypt/<span><span>.well-known/acme-challenge</span></span><br></span></span><div><span><span>When I comment the return 301 it works but I loose the redirection.</span></span></div><div><br><div><div>It seems to me that nginx parses everything where I would expect it to stop at<br><div><span><span>location ^~ /.well-known/acme-challenge { default_type "text/plain"; root /var/www/letsencrypt; }</span><br></span><span></span><div><br>Does anyone know the trick ?<br></div></div></div><span><span></span></span></div></div></div></div></div></div></div></body></html>