nginx反向代理
nginx反向代理配置后总是跑到nginx自身主页, 是什么原因?
192.168.5.12:8090是一个php的网站.
upstream meibeike {
server 192.168.5.12:8090 weight=1 max_fails=2 fail_timeout=30s;
}
server {
listen 8800;
server_name 202.104.149.54;
charset gbk;
access_log logs/12.8800.host.access.log main;
location / {
proxy_pass http://meibeike.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
proxy_pass http://192.168.5.12:8090;
}
location ~ \.php$ {
root html;
fastcgi_pass 192.168.5.12:8090;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
server{
listen 80;
server_name 202.104.149.54;
access_log logs/12-80.host.access.log main;
location / {
root html;
index index.html index.htm;
}
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
server{
listen 80;
server_name 202.104.149.54;
access_log logs/12-80.host.access.log main;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}