網站首頁 編程語言 正文
可以選擇在http{ }中設置:client_max_body_size 200m;
可以選擇在server{ }中設置:client_max_body_size 200m;
還可以選擇在location{ }中設置:client_max_body_size 200m;
三者有區別設置到http{}內,
控制全局nginx所有請求報文大小設置到server{}內,
控制該server的所有請求報文大小設置到location{}內,控制滿足該路由規則的請求報文大小
然后重啟nginx
/etc/init.d/nginx restart
如
server {
listen 8083;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /workspace/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api/ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'POST,GET,OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization';
proxy_pass http://127.0.0.1:8093/api/;
}
location /ws/ {
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X_Forward_For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_pass http://127.0.0.1:8091/;
}
location /images/ {
root /workspace/static/platform;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location /excel/ {
root /workspace/static/platform;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location /engine/ {
root /workspace/static;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
client_max_body_size 20m;
}
原文鏈接:https://blog.csdn.net/weixin_45124380/article/details/121404719
相關推薦
- 2022-09-25 C++ sort比較函數的寫法,最全面的總結
- 2022-10-16 解析React?ref?命令代替父子組件的數據傳遞問題_React
- 2022-02-11 小程序如何把參數設置為全局變量
- 2023-01-31 Android位圖(圖片)加載引入的內存溢出問題詳細解析_Android
- 2022-03-17 .NET?Core使用C#掃描并讀取圖片中的文字_C#教程
- 2022-04-28 Python中print()函數的用法詳情_python
- 2023-05-29 Python中如何給字典設置默認值_python
- 2022-09-22 k8s 存儲卷之 PV & PVC
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支