V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
当一个程序员开始做量化交易
从手动复盘到写一个自己的策略回测工具,我把自己的思考和开发过程记录了下来,希望能对你有所启发。
Promoted by bmpidev2019
coolloyal
V2EX  ›  Linux

Nginx 下泛域名反代报错,有人解决过吗?

  •  
  •   coolloyal · 2014-04-14 15:59:38 +08:00 · 3426 次点击
    这是一个创建于 4124 天前的主题,其中的信息可能已经有所发展或是发生改变。
    server {
    listen 80;
    server_name ~^(www\.)?(?<domain>.+)\..+$;
    index index.php index.html index.htm;

    location / {
    resolver 8.8.8.8
    proxy_pass http://$domain.xxx.com/;
    }
    }

    这个情况502错误,
    4 条回复    1970-01-01 08:00:00 +08:00
    julyclyde
        1
    julyclyde  
       2014-04-14 16:31:54 +08:00
    $domain 可以在server_name里“顺便”声明吗?
    你看看日志咋写的
    cevincheung
        2
    cevincheung  
       2014-04-14 16:42:43 +08:00
    server_name domain.com *.domain.com
    hourui
        3
    hourui  
       2014-04-14 23:37:43 +08:00
    resolver 8.8.8.8
    少了个分号吧,亲。
    chekun
        4
    chekun  
       2014-04-15 15:29:04 +08:00
    resolver 要写到http {} 中去,在server中是无效的,详情参见手册.
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3248 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 11:15 · PVG 19:15 · LAX 04:15 · JFK 07:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.