rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
vi /etc/nginx/nginx.conf
:
worker_processes 2;
:
gzip on;
include /etc/nginx/conf.d/*.conf;
}
vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
:
vi /etc/nginx/conf.d/abc_ichiayi.conf
server {
server_name abc.ichiayi.com abc1.ichiayi.com;
access_log /var/log/nginx/abc.ichiayi.com.access.log main;
error_log /var/log/nginx/abc.ichiayi.com.error.log;
location / {
set_real_ip_from 192.168.11.0/24;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
proxy_pass http://192.168.11.233:80;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering 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;
}
location /292/ {
proxy_pass http://192.168.11.292/;
}
}
vi /etc/nginx/conf.d/xyz_ichiayi.conf
server {
server_name xyz.ichiayi.com;
access_log /var/log/nginx/xyz.ichiayi.com.access.log main;
error_log /var/log/nginx/xyz.ichiayi.com.error.log;
location / {
set_real_ip_from 192.168.11.0/24;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
proxy_pass http://192.168.11.232:80;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering 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;
}
}