Daniel,<br><br>That appears to be like a nice simplification, but I fear it will add quite a lot of complexity on the side you don&#39;t see.  Also, how does it know where to get the SSL information such as the key or cipher suite?  Didn&#39;t see anything in your specification.<br>
<br>Working with what is currently here, I typically put the shared locations into a site.locations file and include it in each server block.  The benefits of the separation are that it is easy to change locations for both servers at once, but if need be I can modify each server separately (say to add a new location in SSL only, for example).  Also, I think it may have to do with performance...  Generally it is much better for NginX if you separate server blocks as much as possible, but I think it is even more so in the case of SSL as SSL adds some overhead.  We should probably wait until someone more versed with the insides to make a final judgement :).<br>
<br>- Merlin <br><br><div class="gmail_quote">On Wed, Apr 1, 2009 at 11:23 AM, Daniel Hahler <span dir="ltr">&lt;<a href="mailto:genml@thequod.de">genml@thequod.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I&#39;d like to enable both http and https within a single server block,<br>
without having to copy the whole block and only change &quot;listen 80&quot; to<br>
&quot;listen 443&quot; and add &quot;ssl on&quot;.<br>
<br>
This appears to work somehow using the &quot;ssl&quot; parameter with &quot;listen&quot;,<br>
but &quot;nginx -t&quot; complains that it can be used together with &quot;default&quot;<br>
only (&quot;&quot;ssl&quot; parameter can be specified for the default &quot;listen&quot;<br>
directive only&quot;).<br>
However, obviously I can use &quot;default&quot; only once.<br>
<br>
Would it be possible to allow usage of the &quot;ssl&quot; parameter without<br>
having to use &quot;default&quot;?<br>
<br>
The example for &quot;ssl&quot; at<br>
<a href="http://wiki.nginx.org/NginxHttpCoreModule#listen" target="_blank">http://wiki.nginx.org/NginxHttpCoreModule#listen</a> uses &quot;default&quot;, but<br>
it&#39;s not mentioned in the documentation that this is a requirement.<br>
<br>
Example:<br>
server {<br>
    server_name <a href="http://example.com" target="_blank">example.com</a>;<br>
    listen 80;<br>
    listen 443 ssl;<br>
<br>
    location / {<br>
        proxy_pass <a href="http://server" target="_blank">http://server</a>;<br>
    }<br>
}<br>
<br>
I&#39;m using nginx/<a href="http://0.7.47." target="_blank">0.7.47.</a><br>
<br>
<br>
Thanks,<br>
Daniel<br>
<font color="#888888"><br>
--<br>
<a href="http://daniel.hahler.de/" target="_blank">http://daniel.hahler.de/</a><br>
<br>
</font></blockquote></div><br>