nginx

servers : /etc/nginx/sites-available
符号连接到sites_enable
完整路径
配置文件 : 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
server
{
#ipv4
listen 80;
#ipv6
listen [::]:80;
server_name b.wangfan.net;
root /home/wangfan/public_html/;
index index.html index.htm index.php;

location /nginx_status
{
stub_status on;
access_log off;
allow all;
}
}

检查配置文件

1
2
3
/etc/init.d/nginx configtest
#errors
nginx -t

反向代理配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
server
{
listen 80;
listen [::]:80;
#入口
server_name xxx.xx.com;
location /
{
proxy_pass http://wangfan.net:9000;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}