<div dir="ltr">You've set port 80 to listen with http2, but you're not passing --http2 to curl so you're getting back an unexpected binary http2 response. Due to lack of ALPN I suggest you don't use http2 on port 80.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 3, 2015 at 8:05 PM, steve <span dir="ltr"><<a href="mailto:steve@greengecko.co.nz" target="_blank">steve@greengecko.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
<br>
I'm having a problem with the configuration of my site... basically, I use a default server config to redirect traffic to my www. site under https, but the http: redirection doesn't work.<br>
<br>
Here's the redirect server config:<br>
<br>
server {<br>
listen <a href="http://101.0.108.116:80" rel="noreferrer" target="_blank">101.0.108.116:80</a> default http2;<br>
listen <a href="http://127.0.1.1:80" rel="noreferrer" target="_blank">127.0.1.1:80</a> http2;<br>
listen [2401:fc00:0:106::6]:80 default http2;<br>
listen <a href="http://101.0.108.116:443" rel="noreferrer" target="_blank">101.0.108.116:443</a> ssl default http2;<br>
listen [2401:fc00:0:106::6]:443 ssl default http2;<br>
<br>
ssl_certificate /etc/nginx/ssl/wildcard.greengecko.co.nz.crt;<br>
ssl_certificate_key /etc/nginx/ssl/wildcard.greengecko.co.nz.key;<br>
<br>
return 301 <a href="https://www.greengecko.co.nz" rel="noreferrer" target="_blank">https://www.greengecko.co.nz</a>$request_uri;<br>
}<br>
<br>
and the return from interrogation of the https: site is fine:<br>
<br>
$ curl --insecure -I <a href="https://greengecko.co.nz" rel="noreferrer" target="_blank">https://greengecko.co.nz</a><br>
HTTP/1.1 301 Moved Permanently<br>
Server: nginx/1.9.6<br>
Date: Tue, 03 Nov 2015 19:02:58 GMT<br>
Content-Type: text/html<br>
Content-Length: 184<br>
Connection: keep-alive<br>
Location: <a href="https://www.greengecko.co.nz/" rel="noreferrer" target="_blank">https://www.greengecko.co.nz/</a><br>
<br>
But with the http: site<br>
<br>
$ curl -I <a href="http://greengecko.co.nz" rel="noreferrer" target="_blank">http://greengecko.co.nz</a> � ������ <br>
the return string, when dumped, looks like this:<br>
<br>
$ od -c /tmp/a<br>
0000000 \0 \0 022 004 \0 \0 \0 \0 \0 \0 003 \0 \0 \0 200 \0<br>
0000020 004 177 377 377 377 \0 005 \0 377 377 377 \0 \0 004 \b \0<br>
0000040 \0 \0 \0 \0 177 377 \0 \0 \0 \0 \b \a \0 \0 \0 \0<br>
0000060 \0 \0 \0 \0 \0 \0 \0 \0 001<br>
0000071<br>
<br>
This happened both with 1.9.5, and the current 1.9.6.<br>
<br>
Can anyone shed any light onto this?<br>
<br>
Cheers,<br>
<br>
Steve<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
-- <br>
Steve Holdoway BSc(Hons) MIITP<br>
<a href="http://www.greengecko.co.nz" rel="noreferrer" target="_blank">http://www.greengecko.co.nz</a><br>
Linkedin: <a href="http://www.linkedin.com/in/steveholdoway" rel="noreferrer" target="_blank">http://www.linkedin.com/in/steveholdoway</a><br>
Skype: sholdowa<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></font></span></blockquote></div><br></div>