user nginx nginx;
worker_processes 2;
error_log /nginx/nginx_error.log crit;
pid /nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
events
{
use epoll;
worker_connections 10000;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'"$request_body"';
access_log /nginx//access.log main;
sendfile on;
keepalive_timeout 10;
upstream test{
server
server
}
server {
listen 80;
server_name nginx;
#charset koi8-r;
location ~^/NginxStatus/{
stub_status on; #monitor nginx
}
location / {
client_max_body_size 4M;
proxy_pass http://test ;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# HTTPS server
#
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate /usr/local/webserver/nginx/conf/server.crt;
ssl_certificate_key /usr/local/webserver/nginx/conf/server.key;
ssl_session_timeout 20s;
location / {
proxy_pass http://jboss ;
}
}
}
|
client_max_body_size 4M;
可以限制nginx代理上传body大小的限制。当通过nginx代理应用服务,上传大文件时,需要修改此参数。
如果上传的文件大小超过了限制,则报413 Request Entity Too Large 错误。
阅读(1228) | 评论(0) | 转发(0) |