E
E
Eugene Wolf2017-01-05 13:30:50
Nginx
Eugene Wolf, 2017-01-05 13:30:50

NginxProxy -> Nginx + ngx_pagespeed, how to configure correctly?

Good day dear!

We have:
1. Nginx, at the front, in the role of ReveseProxy, HTTP / HTTPS, it will also act as a load balancer
2. Several Nginx + PHP-FPM servers "behind", some have ngx_pagespeed installed (servers may be responsible for different sites / services /projects)

Faced a problem:
1. "Main" (front) Nginx "spoils" headers. When referring to the source north, we get:

Expires: Sat, 04 Feb 2017 08:59:15 GMT
Cache-Control: max-age=2587554, public
ETag: W/"PSA-aj-29OAZzvhfX"


If we look from the front server:
cache-control:max-age=44190
etag: W/"PSA-aj-29OAZzvhfX"
expires: Thu, 05 Jan 2017 20:01:14 GMT


As we can see, the cache-control, expires headers have changed, sometimes the E-Tag changes.

Question. How to disable caching on the front-end server (better at all) and change headers on its side? I'm only interested in the direct proxy functions, everything that is needed is cached on the sources.

The second point, which I have been struggling with for the 2nd day, is the ngx_pagespeed module. Which does not want to remove the CSS script from the header in any way. I have already tried every filter variation that came to my mind, including:
  • extend_cache
  • prioritize_critical_css
  • Etc


He doesn’t want to work in any way, as Google asks: “Leave important CSS in the header, put the rest at the end.” Has anyone managed to achieve a similar effect?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question