gpt4 book ai didi

node.js - 413 请求实体太大 nginx/1.14.0

转载 作者:太空宇宙 更新时间:2023-11-03 23:55:34 25 4
gpt4 key购买 nike

当我从本地主机上传图像时,我可以上传任何大小的图像,但是当我尝试通过服务器上传时,当图像大小大于1Mb时,它会给我错误:请求实体太大,我添加了这个client_max_body_size 100M ;并重新启动 nginx,但问题仍然存在有人知道出了什么问题/var/www/abc/abc/nginx.config 路径在这里吗?

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

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/*;
client_max_body_size 100M;
}




<html>
<head>
<title>413 Request Entity Too Large</title>
</head>
<body bgcolor="white">
<center>
<h1>413 Request Entity Too Large</h1>
</center>
<hr>
<center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>

最佳答案

一切都很好,只是 nginx.conf 的路径错误,出现了错误,所以请确保在 nginx.conf 中添加此行时确保 nginx.conf 位于正确的路径

关于node.js - 413 请求实体太大 nginx/1.14.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57369748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com