我使用django和nginx来提供服务。
当使用dev环境(python manage.oy runserver)并做错了什么时,它可以返回500错误。
但是当使用nginx + django并执行相同操作时,它会返回502.
如何配置nginx.conf让它返回500?我的配置如下:
upstream veevaqa.veevaorion.com.upstream
{
server 60.205.56.175:8000 weight=1;
}
server {
listen 80;
server_name veevaqa.veevaorion.com;
location /nginxstatus{
access_log on;
auth_basic "nginxstatus";
auth_basic_user_file htpasswd;
}
location / {
index index.jsp;
proxy_pass http://veevaqa.veevaorion.com.upstream;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}