git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] ProxyErrorOverride on with PHP-FPM


Hi Matthias,

2018-04-11 11:34 GMT+02:00 Matthias Leopold <matthias@xxxxxxxxxxxxxxx>:
Hi,

I'm trying to get rid of the message

[proxy_fcgi:error] ... AH01071: Got error 'Primary script unknown\n'

in error logs (LogLevel notice) when proxying to an php-fpm daemon and the requested php file doesn't exist.

php-fpm config in VirtualHost is

<FilesMatch "\.php$">
        SetHandler  "proxy:unix:/run/php-fpm/www.sock|fcgi://foobar/"
</FilesMatch>

When I set "ProxyErrorOverride on" the error in browser changes from "File not found." to "Not Found

The requested URL /bla.php was not found on this server."


ProxyErrorOverride is only related to the error page to display for certain HTTP error conditions, in order for example to avoid proxying what the backend returns to the external client (so internal errors wouldn't be seen, etc..).
 

In error.log is still get the "Primary script unknown" message. Is there a way to suppress this (without fiddling with LogLevel)??

IIUC you've set LogLevel to 'notice', but according to https://httpd.apache.org/docs/2.4/mod/core.html#loglevel is not enough to avoid displaying the 'error' level ones. You could try with 'crit' probably, but bare in mind that in this way you wouldn't see anymore any log raised at 'error' level (some of them might be important to collect/read).

Hope that helps!

Luca