Springboot項目部署之文件上傳報錯413 Request Entity Too Large錯誤


在項目部署的時候,遇到一個問題, 就是上傳文件的時候報錯 http 請求報 413 Request Entity Too Large錯誤。
后來發先是nginx中未設置 請求體大小。

server {
                listen       80;
                server_name  localhost;
                charset utf-8;
		# nginx 配置客戶端請求體最大值多少M
                client_max_body_size 5M;

                location / {
                        root   /home/record/lb-project/lb-vue;
                        try_files $uri $uri/ /index.html;
                        index  index.html index.htm;
                 }

                location /admin/ {
                        root   /home/record/lb-project/lb-admin-vue;
                        try_files $uri $uri/ /index.html;
                        index  index.html index.htm;
                 }

                location /api/{
                        proxy_set_header Host $http_host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header REMOTE-HOST $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_pass http://localhost:9088/;
                }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
                }
 }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM