Apache 2.4 + PHP-FPM, catching error pages

后端 未结 2 1481
我寻月下人不归
我寻月下人不归 2021-01-13 11:48

Here is my vhost file:

 
   ServerName awesome.dev

   ## Vhost docroot
   DocumentRoot \"/var/www/awesome\"

   ## Directories, ther         


        
相关标签:
2条回答
  • 2021-01-13 12:19

    I used to have the same problem and finally I fixed it.

    Try add this after ProxyPassMatch setting:

    ProxyErrorOverride on
    

    BTW, do not forget your

    ErrorDocument 404 /path/to/file
    

    setting.

    0 讨论(0)
  • 2021-01-13 12:33

    As many problems can occur during apache / php-fpm process, many errors can lead to the response "File not found" and in logs "AH01071: Got error 'Primary script unknown\n'": (double slashes in paths, permissions,...)

    To track them you can:

    • Put in your apache configuration "LogLevel debug" and check error log.
    • And/Or revert temporary your configuration to "simple apache only try", in my case it lead me to permissions problems (www 0751 needed to be 0755) error wich was invisible before.

    Ps: Take care on a other thread, people says that using ProxyErrorOverride for that is "really a bad idea": https://serverfault.com/questions/450628/apache-2-4-php-fpm-proxypassmatch

    0 讨论(0)
提交回复
热议问题