[Linux Ubuntu Nginx] net::ERR_FAILED 413 CORS ERROR

[Linux Ubuntu Nginx] net::ERR_FAILED 413 CORS ERROR

실서버에서 잘되던 업로드가..

개발서버에서 안되기 시작했다.

신경이 개복치마냥 예민해져서는 왜 잘되던게 안될까 뭘까 날까 일까 눌라라라라하다가,

알고보니 환경셋팅이 똑같지 않았었다..

파일업로드의 용량문제로 인한 cors 오류였다.

예전에 해결한 문제였는데, 같은걸 겪고도 기억 못하다니..

이게 다 정신력의 문제다 아하하하

NodeJs Multer-AWS-S3,

React Axios formdata

형식으로 자료를 주고 받았다.

sudo vi /etc/nginx/nginx.conf

들어가서

http { client_max_body_size 15M; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; # SSL Settings ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; # Logging Settings access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # Gzip Settings gzip on; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; # Virtual Host Configs include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }

http에 client_max_body_size 15M 을 추가해준다.

깔끔하게 해결...

from http://developoerty.tistory.com/124 by ccl(A) rewrite - 2021-12-01 20:00:31