VPS侦探论坛

 找回密码
 注册
查看: 4591|回复: 7

LNMP1.2 /substitutions 反代DZ3.2 打不开网站什么问题

[复制链接]
发表于 2015-12-10 20:53:48 | 显示全部楼层 |阅读模式

--user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --add-module=/root/substitutions4nginx-read-only --with-http_gzip_static_module --with-ipv6 --with-http_sub_module

server{
listen 80;
server_name t.playvps.com;  #绑定的域名
access_log off;                #off 关闭日志
location / {
subs_filter 'www.baidu.com' 't.playvps.com' gi;  #substitutions4nginx替换 (使用方法参照官方)
proxy_set_header   X-Real-IP  $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header   Referer http://www.baidu.com;        #强制定义Referer,程序验证判断会用到
proxy_set_header   Host www.baidu.com;                  #定义主机头,如果目标站点绑定的域名个server_name项的吻合则使用$host
proxy_pass http://www.baidu.com;                        #指定目标,建议使用IP或者nginx自定义池
proxy_set_header Accept-Encoding "";                        #清除编码
        }
}

=================================

由于自己的网站域名A (linoed)被移动封了,

所以要注册一个新域名B(使用美国VPS)反代域名A,但是使用如上模板来反代域名A的网站,打开错误就是好像没有网站一样,nginx启动成功

是那里错了呢?

或者有什么其他好的方案,镜像数据库同步就不要了吧,好像很麻烦。

=================================



server
{
listen 80;
server_name www.BBBBBB.com;
location / {
proxy_pass http://www.AAAAAA.org;
proxy_redirecct off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

这样也打不开网站,怎么回事?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-10 21:42:18 | 显示全部楼层


ip被墙吗了,把访问日志开开,看看访问日志里看看能到达吗
两个域名都在同一台vps?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-12-11 11:24:44 | 显示全部楼层

回复 2# 的帖子


ip被墙吗了,把访问日志开开,看看访问日志里看看能到达吗  ----------日志是空白的。

server
{
listen 80;
server_name www.BBBBBB.com;
access_log on;
location / {
proxy_pass http://www.AAAAAA.org;
proxy_redirecct off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log  /var/ftp/dz32.log  access;
}
}

两个域名都在同一台vps?   --------不是同一台,一个美国 ,一个日本

www.AAAAAA.org    ---A  VPS  
IP、域名我都可以打开。

www.BBBBBB.com   --B VPS
如果不是设置反代,正常IP、域名我都可以打开。现在情况是设置反代A的时候就打不开
,但我保证两台服务器是可以相互连接的。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-11 13:02:35 | 显示全部楼层



proxy_redirecct这个拼写错了

nginx reload或重启了吗
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-12-11 17:02:43 | 显示全部楼层

proxy_redirecct off;
proxy_redirecct这个拼写错了


那里错了?
lnmp nginx restart 无数次了。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2015-12-11 17:08:11 | 显示全部楼层

proxy_redirecct off;
proxy_redirecct这个拼写错了


那里错了?
lnmp nginx restart 无数次了。
 楼主| 发表于 2015-12-11 18:11:54 | 显示全部楼层

这与我使用
CloudXNS 的DNS有没有关系?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-12 19:34:48 | 显示全部楼层

回复 6# 的帖子


redirect

lnmp nginx restart 无数次,配置文件有错误一样无法生效
/usr/local/nginx/sbin/nginx -t 测试配置文件是否有错误
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 15:28 , Processed in 0.027464 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表