nginx做代理的优化
[root@lb01 ~]# vim /etc/nginx/conf.d/proxy.conf
upstream web {
server 172.16.1.7:80;
keepalive 16; #开启长连接
}
server {
listen 80;
server_name linux.node.com;
location / {
proxy_pass http://web;
proxy_http_version 1.1; #指定长连接版本
include /etc/nginx/proxy_params;
}
}
[root@web01 ~]# cat /etc/nginx/conf.d/linux.blog.com.conf
server {
listen 80;
server_name linux.blog.com;
root /code/wordpress;
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_keep_conn on; #配置代理http开启长连接
include fastcgi_params;
}
}
本文来自博客园,作者:六月OvO,转载请注明原文链接:https://www.cnblogs.com/chenlifan/p/13651944.html