Planet Ubuntu (planet_ubuntu) wrote, @ 2016-04-12 18:18:00 |
|
|||
Hello again! NGINX 1.9.14 is now available in Ubuntu Xenial. Theres quite a few things we should make known to everyone who uses nginx in Ubuntu, with php5-fpm
currently!
Yes, HTTP/2 is now enabled for nginx-core
, nginx-full
, and nginx-extras
in Ubuntu Xenial. Add http2
to your SSL listener line in your server
blocks, and HTTP/2 will be enabled for that port and site.
For HTTP/2 on non-Xenial Ubuntu releases, you can use the Mainline PPA for Wily and later. Anything before Wily does not have full HTTP/2 support, and very likely will not be usable to get HTTP/2 working as intended.
php7.0-fpm
, and not php5-fpm
, and this will break existing site configurationsThe Ubuntu Xenial packages for nginx
have already been updated for this change, pointing to php7.0-fpm
instead of php5-fpm
.
However, users who have existing site configurations will not benefit from these changes. They must manually apply the changes.
Effectively, this is what a default setup uses to interface with the default php5-fpm
setup on Ubuntu versions before Xenial, passing all PHP processing to the php5-fpm backend. This is from the default configuration file, but its still similar for all PHP passing:
location ~ \.php$ { include snippets/fastcgi-php.conf; # With php5-cgi alone: #fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; }
In Ubuntu Xenial, the TCP listener for php7.0-cgi
will be unchanged, however for php7.0-fpm
, it will be necessary to update the configuration to look like this for existing site configurations:
location ~ \.php$ { include snippets/fastcgi-php.conf; # With php7.0-cgi alone: #fastcgi_pass 127.0.0.1:9000; # With php7.0-fpm: fastcgi_pass unix:/var/run/php7.0-fpm.sock; }
This will prevent HTTP 502 Bad Gateway errors, and will use the updated php7.0-fpm
instead of the php5-fpm
packages.
(If for some reason you still want to have php5-fpm
under Xenial, you will not be able to get support from Ubuntu for this; you will need to use a PPA. I explain this on a different post on my blog.)