跳轉到內容
QQ群

413 Request Entity Too Large 這是因為nginx.conf未配置好

精選回覆

發表於

413 Request Entity Too Large 這是因為nginx.conf未配置好

-------------------------------------
413 Request Entity Too Large
-------------------------------------

這是因為 nginx.conf 未配置好

vi /etc/nginx/nginx.conf


user www-data;
worker_processes auto;
worker_cpu_affinity auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events {
        use epoll;
        worker_connections 51200;
        multi_accept off;
        accept_mutex off;
}

http {
	sendfile on;
	tcp_nopush on;
	types_hash_max_size 2048;
               server_tokens off;
               access_log off;

              server_names_hash_bucket_size 128;
              client_header_buffer_size 32k;
              large_client_header_buffers 4 32k;
              client_max_body_size 200m;
              sendfile_max_chunk 512k;
              keepalive_timeout 60;
              tcp_nodelay on;
	# server_name_in_redirect off;

              fastcgi_connect_timeout 300;
              fastcgi_send_timeout 300;
              fastcgi_read_timeout 300;
              fastcgi_buffer_size 64k;
              fastcgi_buffers 4 64k;
              fastcgi_busy_buffers_size 128k;
              fastcgi_temp_file_write_size 256k;

              gzip on;
              gzip_min_length  1k;
              gzip_buffers     4 16k;
              gzip_http_version 1.1;
              gzip_comp_level 2;
              gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
              gzip_vary on;
              gzip_proxied   expired no-cache no-store private auth;
             gzip_disable   "MSIE [1-6]\.";



	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # 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;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}


#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
#
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}




ESC儲存並離開
:wq




重啟Nginx
/etc/init.d/nginx restart



重新載入Nginx
nginx -t

nginx -s reload

建立帳號或登入後發表意見