<p dir="ltr">Just add another server block on domain1 that listens to 443 ..and redirect it to http if you ..or just give an error</p>
<div class="gmail_extra"><br><div class="gmail_quote">On 8 Sep 2016 11:59 a.m., "Kurogane" <<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Domain 1<br>
<br>
server {<br>
        listen 80;<br>
        server_name <a href="http://domain1.com" rel="noreferrer" target="_blank">domain1.com</a>;<br>
        return 301 $scheme://www.$host$request_<wbr>uri;<br>
}<br>
<br>
server {<br>
        listen 80;<br>
        server_name <a href="http://www.domain1.com" rel="noreferrer" target="_blank">www.domain1.com</a>;<br>
        root  /home/domain1/public_html;<br>
        ...<br>
}<br>
<br>
Domain 2 (SSL)<br>
<br>
server {<br>
        listen 80;<br>
        server_name <a href="http://domain2.com" rel="noreferrer" target="_blank">domain2.com</a>;<br>
        return 301 $scheme://www.$host$request_<wbr>uri;<br>
}<br>
<br>
server {<br>
        listen 80;<br>
        server_name <a href="http://www.domain2.com" rel="noreferrer" target="_blank">www.domain2.com</a>;<br>
        return 301 https://$host$request_uri;<br>
}<br>
<br>
server {<br>
        listen 443 ssl http2;<br>
        server_name <a href="http://www.domain2.com" rel="noreferrer" target="_blank">www.domain2.com</a>;<br>
<br>
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;<br>
        ssl_certificate      /home/nginx/ssl/<a href="http://domain2.com/domain2.com.crt" rel="noreferrer" target="_blank">domain2.com/<wbr>domain2.com.crt</a>;<br>
        ssl_certificate_key  /home/nginx/ssl/<a href="http://domain2.com/domain2.com.key" rel="noreferrer" target="_blank">domain2.com/<wbr>domain2.com.key</a>;<br>
        root  /home/domain2/public_html;<br>
        ...<br>
}<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,269401,269417#msg-269417" rel="noreferrer" target="_blank">https://forum.nginx.org/read.<wbr>php?2,269401,269417#msg-269417</a><br>
<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>
</blockquote></div></div>