nginx反向代理

luceas 2015-01-08 11:45:30
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;
}

}
...全文
90 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧