V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
xinghuan
V2EX  ›  NGINX

请教大佬一个 nginx 跳转规则该怎么写

  •  
  •   xinghuan · 2020-01-03 05:42:39 +08:00 · 1781 次点击
    这是一个创建于 1546 天前的主题,其中的信息可能已经有所发展或是发生改变。
    有数百个域名指向一个服务器,当用户通过任意一个 来访域名.com 访问时跳转到: https://mi.aliyun.com/detail/online.html?domainName=来访域名.com

    要怎么修改下面规则才能识别来访域名自动跳转呢?

    server {
    listen 80;
    server_name a.com;
    if ($host != 'www.a.com') {
    rewrite ^/(.*)$ https://mi.aliyun.com/detail/online.html?domainName=来访域名.com$1 permanent;
    }
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1024 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:21 · PVG 03:21 · LAX 12:21 · JFK 15:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.