<div dir="ltr">I think it is unfortunate that certbot does it this way, with an if statement, which i believe is evaluated in every request. I use something like the following (with your names):<div><br></div><div><div>server {</div><div> listen 80 default_server;</div><div> listen [::]:80 default_server;</div><div> server_name <span style="color:rgb(0,0,0);white-space:pre-wrap">pstn.host www.pstn.host</span>;<br></div><div> return 301 https://<span style="color:rgb(0,0,0);white-space:pre-wrap">$host</span>$request_uri;</div><div>}</div></div><div><br></div><div><br></div><div><div>server {</div><div> listen 443 ssl default_server;</div><div> ssl_certificate /etc/letsencrypt/live/<span style="color:rgb(0,0,0);white-space:pre-wrap">pstn.host</span>/fullchain.pem;</div><div> ssl_certificate_key /etc/letsencrypt/live/<span style="color:rgb(0,0,0);white-space:pre-wrap">pstn.host</span>/privkey.pem;</div><div><br></div></div><div> ....reset of config</div><div>}</div><div><br></div><div>Not part of your question, but I also use the hooks in webroot mode, rather than nginx, for certbot, so it's never modifies my configuration, as the sites-enabled files are managed by a configuration management system across about 100 domains, some with special requirements.</div><div><br></div><div>HTH,<br>Jeff</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 28, 2017 at 11:40 AM, pstnta <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi,<br>
<br>
thanks for answering,<br>
<br>
shouldn't that forward everything to https? so shouldn't it work with just<br>
pstn.host? instead of <a href="https://pstn.host" rel="noreferrer" target="_blank">https://pstn.host</a><br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,277546,277548#msg-277548" rel="noreferrer" target="_blank">https://forum.nginx.org/read.<wbr>php?2,277546,277548#msg-277548</a><br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>