<div dir="ltr">Hi guys,<div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">if ($scheme = "http") {</span><br style="font-family:arial,sans-serif;font-size:12.7272720336914px"><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"> return 301 https://$server_name$request_</span><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">uri;</span><br style="font-family:arial,sans-serif;font-size:12.7272720336914px"><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"> }</span><br></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">Did the job indeed !</span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">Thanks again all for your time and patience !</span></div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">All the best !</span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-21 20:29 GMT+01:00 Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Nov 21, 2014 at 09:02:01AM +0100, JACK LINKERS wrote:<br>
<br>
Hi there,<br>
<span class=""><br>
> As you can see, the template doesn't make separate server blocks for each<br>
> HTTP & HTTPS protocole :<br>
<br>
</span>This part is still true:<br>
<span class=""><br>
> > What you probably want is:<br>
> ><br>
> > listen on http; redirect everything to https.<br>
> > listen on https; process requests normally.<br>
<br>
</span>but your particular access to configure nginx does not appear to allow<br>
you do that.<br>
<br>
The right answer is for you to change your access to configure nginx;<br>
but that is unlikely to happen in the short term.<br>
<br>
You can use an alternative config, along the lines of:<br>
<br>
listen on http and https; if the request was http, redirect to https;<br>
else process requests normally<br>
<br>
That will probably fit your restricted configuration model.<br>
<br>
Add a stanza at server{} level, outside all location{}s<br>
<br>
if ($scheme = "http") {<br>
return 301 https://$server_name$request_uri;<br>
}<br>
<br>
and reload, and see if that does what you want.<br>
<br>
You may want to replace $server_name with $host or your preferred host<br>
name directly, depending on what exactly you want.<br>
<br>
But it should get over the infinite loop of your original config.<br>
<div class="HOEnZb"><div class="h5"><br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<br>
_______________________________________________<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" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>