여러 행이있는 Excel 파일을 처리 할 때 오류 502가 발생합니다. 문제는 파일의 무게 아니다 장고/Nginx에많은 행이있는 Excel 파일 처리시 오류 502 발생
를 사용
는 1MB 미만이다.
이 페이지는 200 행의 파일에서 올바르게 작동하지만 파일에 행이 많을 때 문제가 발생하고 페이지가이 파일을 처리하는 데 너무 오래 걸립니다.
이
오류입니다 :2012/07/28 14:29:54 [error] 18515#0: *34 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST /import/ HTTP/1.1", upstream: "http://127.0.0.1:9000/import/", host: "localhost:8080", referrer: "http://localhost:8080/import/"
나는 변수에 매우 큰 값을 사용하고,하지만 난 같은 오류가 점점 계속.
이
사이트의 구성입니다 :upstream app_server {
server 127.0.0.1:9000 fail_timeout=3600s;
keepalive 3600s;
}
server {
listen 8080;
client_max_body_size 4G;
server_name localhost;
keepalive_timeout 3600s;
client_header_timeout 3600s;
client_body_timeout 3600s;
send_timeout 3600s;
location /static/ {
root /my path/;
autoindex on;
expires 7d;
}
location /media/ {
root /my path/;
autoindex on;
expires 7d;
}
location/{
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
}
그리고 이것은 글로벌 구성입니다 :
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 3600s;
tcp_nodelay on;
client_header_timeout 3600s;
client_body_timeout 3600s;
send_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
client_max_body_size 200m;
client_body_buffer_size 128k;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
수 너 나 좀 도와 줘?
안부
TBH 당신이 쇼 uld는 아마 django-celery와 같은 서버 측 작업이 될 것입니다. –
Django와 같은 소리는 nginx가 예상하는 것보다 파일을 처리하는 데 오랜 시간이 걸리기 때문에 gunicorn이 장고 응답을 반환 할 때까지 기다리지 않습니다. ** 아니면 ** 추락하고 있습니다. 장고 코드가 예외를 기록합니까? 타임 아웃이라고 가정하면 502가 아닌 504를 볼 수 있습니다. –
'업스트림 조기 폐쇄 연결 '은 백엔드쪽에 오류가 있음을 의미합니다. – VBart