• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Issue Pass some specific file from nginx to Apache

Wp_SEO

New Pleskian
Hi all,
i'm using Plesk Onyx 17.8 configured with:
Apache with mod_pagespeed
nginx as reverse provxy
In the Apache side, mod_pagespeed provide to generate on the fly css and js optimized like this:

https://domain.com/wp-includes/css/dist/block-library/A.style.min.css.pagespeed.cf.cOBdefHnvQ.css

This url return a 404 error by nginx because nginx try to serve it (for it is a static css file).

If i change this url adding the Apache port it works correctly because will be serve from Apache:

https://domain.com:7081/wp-includes...y/A.style.min.css.pagespeed.cf.cOBdefHnvQ.css

If i check the proxy_error log i found this kind of row:

2019/04/14 00:16:19 [error] 3465#0: *24416 openat() "/var/www/vhosts/domain.it/httpdocs/wp-content/plugins/wysija-newsletters/css/A.validationEngine.jquery.css.pagespeed.cf.jcn-RfgU3K.css" failed (2: No such file or directory), client: 79.52.50.97, server: domain.it, request: "GET /wp-content/plugins/wysija-newsletters/css/A.validationEngine.jquery.css.pagespeed.cf.jcn-RfgU3K.css HTTP/2.0", host: "domain.it", referrer: "https://domain.it/"

where seems that ngix looking for real file on the filesystem.

The question is: how can i add rule in nginx to pass the process this kind of url to Apache?

I tried something like this:

location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://domain:7081/$request_uri;
}

but seems to be ignored.

Thanks
 
Back
Top