2011-12-14 5 views
9

Ho la seguente voce vhostpagine di errore Nginx non funziona

server { 
    listen  80; 
    server_name example.com www.example.com; 

    #access_log /var/log/nginx/nginx-access.log; 

    location /media/ { 
    root /home/luke/django/solentcms; 
    } 

    location /admin/media/ { 
    root /home/luke/virts/django1.25/lib/python2.7/site-packages/django/contrib/admin/media; 
    } 

    location/{ 
    proxy_pass http://127.0.0.1:8001; 
    } 

    error_page 404 /404.html; 
    location = /404.html { 
      root /home/luke/django/solentcms/404; 
      allow all; 
    } 


    error_page 500 502 503 504 /500.html; 
    location = /500.html { 
      root /home/luke/django/solentcms/404; 
      allow all; 
    } 

} 

Tuttavia, 404 e di 50x errori sono ancora reindirizzato alle orribili idee nginx predefinita pages.Any per spiegare perché? Questa sintassi funziona su uno dei miei altri server.

Cheers.

risposta

17

Gli errori provengono dal tuo back-end? Potrebbe essere necessario aggiungere proxy_intercept_errors su; insieme al tuo proxy_pass.

+2

Grazie, l'ha risolto. – Crooksey

+6

Se stai usando fastcgi, l'impostazione è 'fastcgi_intercept_errors on;' – rmarscher

+5

e per uwsgi c'è 'uwsgi_intercept_errors su ', –