Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I've recently been trying to help out the community by building a pimcore based nginx vhost config. Everything works very well from what I can see except for 1 small issue. If any of the pages (cms pages) consume an rss feed for instance and the rss feed returns a 503 error (unavailable / 404 etc) then the entire page is forwarded to a 503 / 404 error page instead of just disabling the load of that item. This issue does not show up on apache.

The problem that occurs is lets say for instance the /about is a cms page that includes an rss feed. The about page is valid however the feed that is consumed and to be displayed in the page returns a 503 error. Nginx appears to be picking up the included asset and redirects the top level page (/about) to an error page instead of rendering the majority of the page. The config is a little bit dirty at the moment but fully working as I've tried many different things to make this work however I can't find the correct config set to fix the issue. Setting the interal; value within the / or .php locations do not appear to be changing anything either.

If someone can help me with this issue then I can work on securing the actual document root before adding it back into community documentation.

The standard vhost uses:

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/;

The file that I load per vhost looks like the following:

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   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;
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;
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.