• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question proxy_pass php

andyxyz

Basic Pleskian
Hi all,

This is driving me CRAZY!!

I am trying to use the following to proxy off a sub folder eg example.co.uk/blog to wordpress on wordpress.example.co.uk

location /blog {
proxy_pass http://wordpress.example.co.uk/;
}

text / image / html / work fine

however, any php file does not work and it looks like nginx tries to process php locally

[crit] 24184#0: *67578 connect() to unix:///var/www/vhosts/system/example.co.uk/php-fpm.sock failed (2: No such file or directory) while connecting to upstream

apache is off (Proxy mode disabled) so only nginx in use,

what am I missing?
 
It might not be enough to switch Apache off. You will need to set PHP to "PHP-FPM via Nginx", too. Else, .php-requests will be forwarded to Apache. As Apache is not acitve, this fails and causes the "error connecting to upstream" that you are seeing. The setting needs to be done even if you are not processing PHP on your local server. The key is that .php traffic must not be filtered out by Nginx and directed to the (missing) Apache server before the location rule is reached.

Edit: Another solution might be to turn off PHP completely. It won't be served by your Plesk system anyway but by the external system. Whether this is a good solution depends on whether you need PHP on your local web space for other directories or not.
 
sorry.. should have said.. yes php is set to be managed by nginx (they recently fixed the bug where turning apache off would cause a error if you left php running as apache.. now turning off proxy automatically sets php to nginx also which is cool)

Disabling php is an interesting idea.. however, it had no effect (other than to change the error)

503 GET /blog/php.php HTTP/1.1
 
Last edited:
Back
Top