You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthias Leopold <ma...@leopold.priv.at> on 2018/04/11 09:34:06 UTC

[users@httpd] ProxyErrorOverride on with PHP-FPM

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."

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

thx
matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


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

Posted by Luca Toscano <to...@gmail.com>.
Hi Matthias,

2018-04-11 11:34 GMT+02:00 Matthias Leopold <ma...@leopold.priv.at>:

> 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