您的位置:首页 > 运维架构 > Nginx

今天解决了Nginx跳转问题

2016-02-24 11:12 507 查看
我的是centos 5.5

直接新建/etc/yum.repos.d/nginx.repo 并添加相关内容,

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/$releasever/$basearch/

gpgcheck=0

enabled=1

傻瓜式的安装yum install nginx

如果要删除: yum remove nginx

安装问题可以参看官网:http://wiki.nginx.org/Install

安装好的相关目录:nginx 执行程序 /usr/sbin/nginx

配置文件:/etc/nginx/nginx.conf

nginx.conf 包含虚拟主机配置 /etc/nginx/conf.d/default.conf

以前跳转的其他网站一直出问题,今天终于解决了,代理服务器(proxy_pass http://192.168.1.100)不用域名用IP就行了

server

{

listen 80;

server_name www.abc.com;

location / {

if ( $query_string !~* "Source=abc") {

rewrite ^/$ ?Source=abc;

}

proxy_pass http://192.168.1.100;

error_log logs/vancl_error_log debug;

proxy_set_header Host $host;

proxy_set_header X-Real-Ip $remote_addr;

proxy_set_header X-Forwarded-For $remote_addr;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: