pcre 编译安装 nginx
conf/vhost/test.conf
upstream admin {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name admin.xxx.dev;
location / {
proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
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_pass http://admin;
}
access_log /home/wwwlogs/admin.xxx.dev.log access;
}
upstream jg {
server 127.0.0.1:8088;
}
server {
listen 80;
server_name jg.yyy.dev;
location / {
proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
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_pass http://jg;
}
access_log /home/wwwlogs/jg.yyy.dev.log access;
}
upstream student {
server 127.0.0.1:8898;
}
server {
listen 80;
server_name www.yyy.dev;
location / {
proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
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_pass http://student;
}
access_log /home/wwwlogs/yyy.dev.log access;
}
upstream lender {
server 127.0.0.1:8888;
}
server {
listen 80;
server_name www.xxx.dev;
location / {
proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
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_pass http://lender;
}
access_log /home/wwwlogs/xxx.dev.log access;
}
upstream stat {
server 127.0.0.1:8081;
}
server {
listen 80;
server_name stat.xxx.dev;
location / {
proxy_next_upstream http_502 http_504 http_404 error timeout invalid_header;
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_pass http://stat;
}
access_log /home/wwwlogs/stat.xxx.dev.log access;
}
原文链接:[http://wely.iteye.com/blog/2224145]