• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Ubuntu 14.04 Nginx HTTP/2 Directive, NPN & ALPN

By Abhishek Ghosh August 23, 2016 12:22 am Updated on August 23, 2016

Ubuntu 14.04 Nginx HTTP/2 Directive, NPN & ALPN

Advertisement

Previously, we wrote how to upgrade Ubuntu 14.04 LTS running Nginx to support HTTP/2 avoiding recompilation or actual stopping the server. Here is a Handy Guide For the New Users Around Ubuntu 14.04 Nginx HTTP/2 Directive, NPN & ALPN. Sadly, HTTP/2 is Not Exactly Easy Like SPDY. The reasons are obvious – SPDY, as well QUIC, HTTP/1.1 is within HTTP/2. Sadly, what we have not said in that easy upgrading of Nginx guide is about NPN & ALPN. Let us handle one by one.

 

Ubuntu 14.04 Nginx HTTP/2 Directive

 

That means, what you’ll add in /etc/nginx/sites-enabled/default file. First you will have these things :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
         http2_max_concurrent_streams 128;   #default
         http2_max_concurrent_streams 64;
         http2_streams_index_size     32;    #default
         http2_streams_index_size     64;    #default
         http2_idle_timeout           30s;   #default
         http2_recv_timeout           3m;    #default
         http2_chunk_size             200k;
         http2_max_field_size         4096;  #default
         http2_max_header_size        16384; #default
         http2_pool_size              8192;
...

Which we have not changed are marked as #default. Official documentation is here :

Advertisement

---

Vim
1
https://nginx.org/en/docs/http/ngx_http_v2_module.html

You need to add this directive too :

Vim
1
add_header Alternate-Protocol 443:npn-http/2;

With older HTTP/1.1 and SPDY, we used this :

Vim
1
add_header Alternate-Protocol 443:npn-http/2;

Add it higher (I mean to cover all location directives), otherwise it is not impossible some browser may miss the header advertisement for a particular content type. Alternate-Protocol is used by servers to tell the clients where they can connect directly with the given protocol. For example an HTTP/1.1 server could reply with Alternate-Protocol: 9999:h2 to tell the client to connect to a different port (9999), knowing that behind that port there is a HTTP/2 server. Without this header, a client would not know what protocol to speak on port 9999.

 

Testing Ubuntu 14.04 Nginx HTTP/2 With Google Chrome Browser

 

Now, you need to test whether things are working or not. Open Google Chrome browser. Now load your website’s any webpage. Open Developer Tool, select Network. Right click on the waterfall (click where Method, Status etc written) to evoke an option menu and click to add Protocol column. Now click Disable Cache option and reload the webpage. If you used our guide how to quickly upgrade Ubuntu 14.04 LTS running Nginx to support HTTP/2 or similar method, then protocol will be HTTP/1.1. We can understand your sadness – Google Chrome browser is not counting as HTTP/2.

Ubuntu 14.04 Nginx HTTP-2 Directive NPN ALPN

Now, test on SSL Labs. You’ll see that, ALPN shown as no, NPN shown as yes. Your server supports HTTP/2, but is not ALPN capable. For an ALPN capable server, Alternate-Protocol is just informative. Before May 31st, 2016 a protocol named NPN (Next Protocol Negotiation) was used. That was not a very efficient protocol, but it did the job. There is a newer negotiation protocol called ALPN (Application-Layer Protocol Negotiation). This is a more efficient version with more future-oriented features. Obviously, switching from NPN to ALPN there are far more benefits. However, web servers that in turn need at least OpenSSL 1.0.2 to run HTTP/2 with ALPN. That thing is very difficult to bring on Ubuntu 14.04. Google Chrome discontinued supporting NPN. Run nginx -V to see the OpenSSL is of 2014. With Ubuntu 16.04 LTS, you’ll by default get HTTP/2 with ALPN. It does not mean that you can not force Ubuntu 14.04 LTS to get HTTP/2 with ALPN. Most users were using old versions of Ubuntu, PHP 7 is not always a choice for all web servers (which is default for Ubuntu 16.04 LTS). In previous guide we helped you to upgrade to HTTP/2 in easy way. Unless you are upgrading step by step, for running website it is risky to jump to newest, specially with self managed servers.

.fail domain costs huge. Marketing can make anything king. It is not that Google Chrome would break if continued to support NPN. Invariably either you need to upgrade that Nginx or upgrade your Ubuntu/Debian/CentOS. Obviously, many users will think about first option. We will suggest so too in case PHP application demands work to support PHP 7.

 

How to Make Ubuntu 14.04 Nginx HTTP/2 Working With ALPN?

 

Frankly either you need to compile yourself or use someone’s compiled version. We are suggesting to follow CloudFlare’s way – compile Nginx from source supporting both SPDY and HTTP/2.

Vim
1
https://blog.cloudflare.com/open-sourcing-our-nginx-http-2-spdy-code/

You may find compiled version of Nginx by someone on GitHub with that patch. We will release our compiled tested version for Ubuntu 16.04 LTS, because it will be meaningless for us to work with older version. With these information, you are up to date to August 2016 around the basics.

Tagged With ubuntu maximum concurrent streams

This Article Has Been Shared 885 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Ubuntu 14.04 Nginx HTTP/2 Directive, NPN & ALPN

  • SELinux and Security in the Context of Cloud Servers

    SELinux Was Developed By United States National Security Agency (NSA). SELinux and Security in the Context of Cloud Servers Can Be Questionable.

  • Security Concerns of Server Virtualization and Solutions

    Recent discovery of VENOM and related critical bugs in the Xen, KVM, and native QEMU virtual machine platforms again brought the topic Security Concerns of Server Virtualization in to lime light. VENOM was unknown, from Heartbleed, what we have learned is quite clear – frankly there is nothing to do with the unknown, undiscovered bugs […]

  • How to Add DMARC, DKIM, SFP to Avoid Email Spoofing

    Commonly, Transactional Email Services Like Mandrill is used With Google Apps. Here is How to Add DMARC, DKIM, SFP to Avoid Email Spoofing.

  • Fix Nginx OCSP ERROR : OCSP Response Expired

    Here is How to Fix Nginx OCSP ERROR – OCSP Response Expired After Enabling OCSP Stapling on Nginx. Error is Due to Certain Criterion of RFC.

  • Google App Engine and PHP : Beginners Guide

    Google App Engine now supports PHP. There is separate Plugin for WordPress. Support for phpMyAdmin and all PHP-MySQL web softwares and frameworks is available.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Ubuntu 14.04 Nginx HTTP/2 Directive, NPN & ALPN," in The Customize Windows, August 23, 2016, February 5, 2023, https://thecustomizewindows.com/2016/08/ubuntu-14-04-nginx-http2-directive-npn-alpn/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT