[英]Nginx Url forwarder to another domain (keeping the rest of the url)
我有一個域,example.com,我希望 nginx 自動轉發任何訪問 example.com/ABC 的人 example2.com/file.html?x=ABC 。 純 nginx 可以實現這樣的事情嗎?
您可以創建重寫規則以從舊域轉發到新域。
server {
listen 80;
server_name example.com;
return 301 http://new.example.com$request_uri;
}
文檔: http : //nginx.org/en/docs/http/converting_rewrite_rules.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.