我找不到一個特定的重寫規則im嘗試的例子。NGINX通配符重寫在同一個服務器模塊
我想有一個重寫規則,例如只輸入子域名。
https://sub.example.com/ - >https://example.com/directory1/directory2/sub
從香港專業教育學院一直在努力一下這個看起來像最近的代碼我有。
server_name example.com;
if ($host = *.example.com)
return 301 https://example.com/directory1/directory2/$1;
}
[nginx子域重寫]的可能重複(https://stackoverflow.com/questions/2498712/nginx-subdomain-rewrite) –