Title: Http2 don&#8217;t work on Nginx.
Last modified: May 23, 2019

---

# Http2 don’t work on Nginx.

 *  [pahomka](https://wordpress.org/support/users/pahomka/)
 * (@pahomka)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/http2-dont-work-on-nginx/)
 * Hello! Thank you, for your plugin!
    Function http2 push don’t work just `header("
   Link: </css/styles.css>; rel=preload; as=style", false);` In nginx, you need 
   add `http2_push_preload on;` in section `server {};`. If you use this function
   without `http2_push_preload on;` in nginx, it’s don’t work as a push, it’s work
   as normal resource download. In Chrome dev tools (F12 key, Network tab) you will
   see different betwee initiator “Other” and “Push/Other”. Yet – pls add push only
   for first resource downloading, across cookie, for example that:
 * > `if(empty($_COOKIE[“http2push”]))
   >  { setcookie(“http2push”,”1″); header(“Link:
   > </css/styles.css>; rel=preload; as=style”, false); header(“Link: </css/jquery.
   > fancybox.css>; rel=preload; as=style”, false); }`
 * It’s great work for already caching resources, they don’t pushing again.
    Sorry
   for my English =)

The topic ‘Http2 don’t work on Nginx.’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [HTTP/2](https://wordpress.org/support/topic-tag/http2/)

 * 0 replies
 * 1 participant
 * Last reply from: [pahomka](https://wordpress.org/support/users/pahomka/)
 * Last activity: [6 years, 12 months ago](https://wordpress.org/support/topic/http2-dont-work-on-nginx/)
 * Status: not resolved