• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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