Nginx / PHP-FPM在外部设置404 / 5xx

所以我最近一直在试图通过构build一个基于pimcore的nginx vhostconfiguration来帮助社区。 除了一个小问题之外,一切工作都很好。 如果任何页面(cms页面)使用rss提要作为实例,并且rss提要返回503错误(不可用/ 404等),则整个页面被转发到503/404错误页面,而不是仅仅禁用项目。 这个问题不会显示在Apache上。

发生的问题可以说,例如,/ about是一个cms页面,其中包括rss提要。 关于页面是有效的,但是消耗的并且将在页面中显示的馈送返回503错误。 Nginx似乎正在拾取包含的资产,并将顶层页面(/ about)redirect到错误页面,而不是渲染大部分页面。 configuration是有点肮脏的,但完全正常工作,因为我已经尝试了许多不同的事情,使其工作,但我找不到正确的configuration集来解决这个问题。 设置内部; / / .php位置内的值也不会改变任何内容。

如果有人可以帮助我解决这个问题,那么我可以在保存实际的文档根目录之前,将其重新添加到社区文档中。

标准的虚拟主机使用:

server { listen 80; server_name _; root /data/www/pimcore; access_log /var/log/nginx/$host-access.log; error_log /var/log/nginx/pimcore-error.log debug; include /etc/nginx/conf.d/_tpl/pimcore.cf; } 

我通过虚拟主机加载的pimcore.cf文件如下所示:

 index index.php index.html index.htm; location ~* \.(js|css|png|jpg|jpeg|gif|ico|xml|swf|flv|eot|ttf|woff|pdf|xls|htc)$ { access_log off; log_not_found off; expires 360d; add_header Pragma "public"; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; access_log off; try_files /$uri $uri/ /website/var/assets$uri /website/var/(tmp|assets|plugins|areas)$uri /plugins/.*/static$uri /index.php?$args; } location @pimcore{ try_files $uri =200; } location ~* \.php$ { try_files /$uri $uri/ /index.php?$args =200; fastcgi_index index.php; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/lib/php/php.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; internal; } location / { # First attempt to serve request as file, then as directory, then fall back to index.html # try_files $uri $uri/ /index.php/$request_uri; try_files /$uri $uri/ /index.php?$args; error_page 404 500 501 503 = @pimcore; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt{ access_log off; log_not_found off; } location ~ /.ht { deny all; access_log off; log_not_found off; }