nginx比较强大,可以针对单个域名请求做出单个连接超时的配置.
比如些动态解释和静态解释可以根据业务的需求配置
proxy_connect_timeout :后端服务器连接的超时时间_发起握手等候响应超时时间
proxy_read_timeout:连接成功后_等候后端服务器响应时间_其实已经进入后端的排队之中等候处理(也可以说是后端服务器处理请求的时间)
proxy_send_timeout :后端服务器数据回传时间_就是在规定时间之内后端服务器必须传完所有的数据
server
{
listen 80;
server_name www.qq.cn;
index index.jsp index.do index.html;
root /data/webapp/qqroot;
#limit_conn crawler 20;
location /(WEB-INF)/ {
deny all;
}
location / {
proxy_pass http://192.168.1.31:8081;
proxy_connect_timeout 500s;
proxy_read_timeout 500s;
proxy_send_timeout 500s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
location ~* (\.jpg)|(\.gif)|(\.png)|(\.swf)|(\.html)|(\.htm)|(\.exe)|(\.flv)|(\.doc)|(\.rar)|(\.rtf)|(\.bmp)|(\.xls)$
{
root /data/webapp/qqroot/;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
}
分享到:
相关推荐
nginx timeout 配置 全局timeout 局部timeout web timeout nginx比较强大,可以针对单个域名请求做出单个连接超时的配置. 比如些动态解释和静态解释可以根据业务的需求配置 proxy_connect_timeout :后端服务器连接的...
本文介绍 Nginx 的 超时(timeout)配置。分享给大家,具体如下: Nginx 处理的每个请求均有相应的超时设置。如果做好这些超时时间的限定,判定超时后资源被释放,用来处理其他的请求,以此提升 Nginx 的性能。 ...
理解了下nginx 所有timeout相关的配置,如下: keepalive_timeout HTTP 有一个 KeepAlive 模式,它告诉 webserver 在处理完一个请求后保持这个 TCP 连接的打开状态。若接收到来自客户端的其它请求,服务端会利用这个...
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 error_log /var/log/...
#keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; #开启gzip压缩 gzip on; gzip_disable "MSIE [1-6]."; #设定请求缓冲 client_header_buffer_size 128k; large_client_header_buffers 4 ...
client_body_timeout 3m; send_timeout 3m; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65;
nginx-php服务器配置,已经测试可以正常运行thinkphp框架,重写已经配好
proxy_read_timeout
4.window下负载均衡配置将nginx.conf文件直接覆盖原有的,然后修改server 192.168.1.xxx:端口 max_fails=1 fail_timeout=600s; server 192.168.1.xxx:端口 max_fails=5 fail_timeout=600s; 为你搭建的服务器地址...
keepalive_timeout 65; #配置共享会话缓存大小 ssl_session_cache shared:SSL:10m; #配置会话超时时间 ssl_session_timeout 10m; #最大数据长度 client_max_body_size 200m; #引入配置 include ./...
一、啥时候用到 用来设置请求资源和服务器返回的时间,保证一个请求占用固定时间,超出后报504超时!这样可以保证一个请求占用过长时间。 二、主要参数 使用nginx服务器如果遇到... fastcgi_read_timeout是指fast
主要介绍了Nginx中HTTP的keepalive相关配置,以及Nginx的Httpd守护进程相关的keepalive timeout配置,需要的朋友可以参考下
主要介绍了完美解決Nginx 504 Gateway time-out问题,需要的朋友可以参考下
主要介绍了Nginx PHP-Fcgi中因PHP执行时间导致504 Gateway Timeout错误解决记录,本文的解决方法得来不易,需要的朋友可以参考下
语法: proxy_connect_timeout time; 默认值: proxy_connect_timeout 60s; 设置与后端服务器建立连接的超时时间。应该注意这个超时一般不可能大于75秒。 语法: proxy_read_timeout time; 默认值: proxy_read_timeout
解决方法是在nginx的配置文件下,加上以下配置: client_max_body_size 50m; //文件大小限制,默认1m client_header_timeout 1m; client_body_timeout 1m; proxy_connect_timeout 60s; proxy_read_timeout
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; ... worker_connections 1024;... keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf;
nginx常用的超时配置说明 client_header_timeout 语法 client_header_timeout time 默认值 60s 上下文 http server 说明 指定等待client发送一个请求头的超时时间(例如:GET / HTTP/1.1).仅当在一次read中,没有...