Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试让 nginx 重写
http://subdomain.example.com
至
http://example.com?username=subdomain
而且没有任何运气。重要的是用户在浏览器中看到前一个 URl,但 nginx 将其解释为后一个 URL。
提前感谢您的帮助。
nginx配置:
server { server_name ~^(?<subdomain>.+?)\.example\.com$; rewrite ^ /?username=$subdomain redirect; }