server {
listen 80; #侦听端口
server_name www.xx.cn; #定义使用www.xx.com访问
#charset koi8-r;
#access_log logs/host.access.log main; #设定本虚拟主机的访问日志
client_max_body_size 30m; #文件最大大小
proxy_connect_timeout 600; #设置超时时间
proxy_read_timeout 600;
proxy_send_timeout 600;
location / {
root /; # 定义服务器的默认网站根目录位置
index index.html index.jsp; # 定义首页索引文件的名称
proxy_pass http://127.0.0.1:8180 ; #请求转向mysvr 定义的服务器列表
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
本文详细解析了Nginx服务器的配置文件,包括监听端口、服务器名称、客户端最大请求体大小、代理连接及读写超时设置、站点根目录、首页索引文件、错误页面重定向等关键配置项。
1727

被折叠的 条评论
为什么被折叠?



