概述
http {
upstream www {
server xxx.xxx.xxx.xxx:8088 max_fails=3 fail_timeout=30s;
}
upstream bbs {
server xxx.xxx.xxx.xxx:8080 max_fails=3 fail_timeout=30s;
}
server {
listen 80;
server_name www.abc.com;
location / {
index index.html index.php index.jsp index.htm;
proxy_pass http://www;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffers 32 4K;
}
log_format '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'"$server_addr;" "$upstream_addr "';
}
server {
listen 80;
server_name bbs.abc.com ;
location / {
index index.html index.php index.jsp index.htm;
proxy_pass http://bbs;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffers 32 4K;
}
}
}
最后
以上就是鲤鱼面包为你收集整理的nginx多端口配置:同一个ip,不同域名,不同端口号,根据nginx配置来进行转发的全部内容,希望文章能够帮你解决nginx多端口配置:同一个ip,不同域名,不同端口号,根据nginx配置来进行转发所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复