› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
xinghuan
V2EX  ›  NGINX

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

  •  
  •   xinghuan · Jan 3, 2020 · 2723 views
    This topic created in 2460 days ago, the information mentioned may be changed or developed.
    有数百个域名指向一个服务器,当用户通过任意一个 来访域名.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;
    }
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1359 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 16:42 · PVG 00:42 · LAX 09:42 · JFK 12:42
    ♥ Do have faith in what you're doing.