I use Nginx as a Web Server and Reverse Proxy for Apache on Ubuntu 14.04 Server. The configuration looks exactly like this: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-16-04-server
I use mod_pagespeed Apache module to optimize the pages. It works good for the page itself, removing whitespace and comments, so I can say it rewrites text/html.
However, it does not work on minifying JS, CSS or image files, combining CSS/JS or even rewriting images. No errors in Apache or Nginx log files. In conf file I changed this to:
ModPagespeedRewriteLevel PassThrough
Update: I noticed many errors in Nginx error log file like this one:
/*
2017/03/18 23:55:38 [error] 3119#3119: *430 openat() "/etc/nginx/html/js/jquery/plugins/enquire.js" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /js/jquery/plugins/enquire.js HTTP/1.1", host: "blabla-bla.com", referrer: "http://blabla-bla.com/"
*/
Well, I see mod-pagespeed gets files from "/etc/nginx/html" not from root directory of website /var/www/user/data/www/blabla-bla.com/js/.... The referrer is: "http://blabla-bla.com/", even I am using "https://blabla-bla.com/" with https redirection.
Has anyone had this problem before?
I would be grateful for any suggestions!