-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update NGINX SPDY patch for 1.9.15 #36
base: master
Are you sure you want to change the base?
Update NGINX SPDY patch for 1.9.15 #36
Conversation
See blog.cloudflare.com/open-sourcing-our-nginx-http-2-spdy-code
Btw. the patch also applies to 1.11.0 with some fuzz, but I have only tested it on 1.9.15. |
@jgrahamc If you want to keep the 1.9.7 patch around, I could also rename the updated patch and send a separate bugfix for the spdy directives in the old patch. |
This is cool. Can you submit an updated patch instead so we can keep the old one around as well? |
08b4112
to
b8ebac6
Compare
@jgrahamc I have separated the patch and fixed the non-working |
Btw. I tested the 1.9.15 patch against 1.11.0 and it works fine. Current stable 1.10.0 is identical to 1.9.15 so it'll work too. |
Using with both But when I test this patch in 1.9.15 and 1.11.0, it's return same error when without both
src/http/modules/ngx_http_ssl_module.c :
gcc (GCC) 4.9.1 20140922 (Red Hat 4.9.1-10) del line 409 & 445, it's work. |
Works fine against nginx 1.11.0 and OpenSSL 1.0.2h (with ChaCha20 patch). I am building nginx as an Ubuntu 16.04 package. Thanks for your work @felixbuenemann |
@kn007 I believe the extra block was added for C89 compatibility, where all variables have do be declared at the start of a block. I'm not sure why that leads to a compile error for you. One thing that looks problematic about the above code is that if only HTTP2 is compiled, there's an unmatched |
@kn007 Oh, I just noticed I misread your first comment, you were talking about the case where only |
The various spdy configuration directives were still marked as deprecated by the http v2 module in the existing patch. Rhis change removes the deprecation so that the directives defined by the spdy module can be used again.
Tis fixes a compile error caused by the 1.9.7 NGINX SPDY patch due to an unmatched else branch, if the http_v2 module was enabled, but the spdy module was disabled.
This should make it clearer which version this patch is targeting, now that there is another patch for 1.9.15.
This updates the 1.9.7 patch to work with NGINX 1.9.15 and also fixes two problem with the previous patch, that did not re-enable spdy directives that were marked as deprecated by the http2 module and failed to compile when the http2 module was enabled and spdy was disabled.
b8ebac6
to
7c23d27
Compare
@kn007 I have updated the 1.9.7 and 1.9.15 patches to fix the compile problem Please do not use your fix removing lines 409 and 445, it is wrong and will only work by accident. Thanks for the report! |
@jgrahamc I have kept the 1.9.7 patch fixes separate. I can combine them into a single commit and/or move them over to a separate PR if you prefer. |
@felixbuenemann Got it, thank you. That's very kind of you. |
@jgrahamc It would be nice if the nginx spdy patch was mentioned in the |
The least I can do is write a big thank you for your time, effort and eventually the SPDY patch for Nginx 1.10 @felixbuenemann |
nginx 1.11.1 test pass |
Not working anymore for me :
But still working with https://raw.githubusercontent.com/felixbuenemann/sslconfig/b8ebac6a337e8e4e373dfee76e7dfac3cc6c56e6/patches/nginx_1_9_15_http2_spdy.patch |
@angristan Can't reproduce, works fine for me on 1.11.1 with only ssl module, ssl + http2, ssl + spdy and ssl + http2 + spdy. So you'd have to be a bit more specific. Maybe the patch got applied incorrectly? This script should work: #!/bin/sh
set -e
git clone https://github.com/felixbuenemann/sslconfig.git
cd sslconfig
git checkout updated-nginx-1.9.15-spdy-patch
cd ..
git clone https://github.com/nginx/nginx.git
cd nginx
git checkout release-1.11.1
git apply ../sslconfig/patches/nginx_1_9_15_http2_spdy.patch
./auto/configure --prefix=/opt/nginx-1.11.1 \
--with-http_ssl_module \
--with-http_spdy_module \
--with-http_v2_module
make |
I'm using the patch this way : https://github.com/Angristan/nginx-autoinstall/blob/master/nginx-autoinstall.sh#L420 |
@angristan Please using the laster version patch and try it again: See this: |
@kn007 this one is working thx |
How do you test if it is actually using SPDY? Chrome doesn't support it anymore and Firefox says it's using |
@raeesiqbal NGINX Amplify gives insights: https://amplify.nginx.com/ |
You can test with Firefox by disabling http2 for the port in nginx or add another port with only spdy. |
@wangqiliang 请用英文。而且不要以链接方式来评论。你可以尝试使用Google Translate来附上你想评论的内容。 wangqiliang sending a feedback about when using IE9 to visit website with nginx 1.11.1&spdy patch, sometime will return ~4-bits anomaly contents and TTFB has reached 30000ms. When not using |
@kn007 Sorry, it is my fault. |
@wangqiliang It's OK. Please excuse any mistakes for my english. |
@wangqiliang You can only use spdy on port 80, if you have a load balancer like haproxy in front of your nginx which handles SSL termination and ALPN/NPN negotiation. If you use spdy or http2 on a port without ssl in NGINX, it will always use that protocol without negotiation. So the simple answer is, don't set spdy on port 80, only use it on 443. |
@felixbuenemann |
@felixbuenemann @kn007 From Wikepedia,
So that is my fault. Thanks for your kindness! |
Do not work in 1.11.5. |
@kn007, that repo patch does not work with you add dynamic modules. |
@felixbuenemann |
@natnet00 Have you tried the patch linked by kn007 above? |
@felixbuenemann nope have not tried it yet |
@felixbuenemann both also doesn't work with 1.11.6 :/ |
@lenovouser The patch linked by kn007 indeed works for 1.11.6. |
@injust nope, see cujanovic/nginx-http2-spdy-patch/issues/1 and |
@lenovouser I am upgrade Nginx to 1.11.6 withi this path last week, it's working. |
@lenovouser Do you using nginx-spdy-1.11.5+.patch, it's working well. |
@kn007 weird, what NGINX source are you pulling from? I use |
@lenovouser Yes, i am using |
Which one of the two files are you using? Because both are failing for me |
@lenovouser |
So weird. Works on my local machine, but the Docker container I am trying to build it in fails. Well. Seems like I have to go find out the bug myself. Thanks for your help! |
@lenovouser You are welcome, good luck! |
So, I found the issue. In case anyone reads this in the future and you're using Alpine Linux, just do a |
@lenovouser It's probably using a busybox version of patch by default. |
dude, you saved my day :) |
This updates the patch to work with NGINX 1.9.15 and also fixes a problem with the previous patch, that did not re-enable the
spdy_*
directives that were marked as deprecated by the http2 module as well as fixing a compile problem when the http2 module is enabled, but spdy is disabled.