使用 NGINX 將 URL 從路徑封鎖到子網域

使用 NGINX 將 URL 從路徑封鎖到子網域

我想實現這樣的 url 重寫:
https://documentation.domain.com/loginto https://app.domain.com/login
https://api.domain.com/loginto https://app.domain.com/login
,任何帶有 url {anything}.domain.com/login to 的 sudomainhttps://app.domain.com/login

https://app.domain.com/sdksto https://documentation.domain.com/sdks(保留所有查詢參數)
https://api.domain.com/sdksto https://documentation.domain.com/sdks(保留所有查詢參數)
,任何帶有 url {anything}.domain.com/sdks 的 sudomainhttps://documentation.domain.com/sdks

https://app.domain.com/restApito https://documentation.domain.com/restApi(保留所有查詢參數)
https://api.domain.com/restApito https://documentation.domain.com/restApi(保留所有查詢參數)
,任何帶有 url {anything}.domain.com/restApi 的 sudomainhttps://documentation.domain.com/restApi

上述所有域和子域都位於 cloudflare 後面,並在完全嚴格模式下啟用了 SSL。我怎樣才能做到這一點?無論我做什麼,我總是收到“太多重定向”

帶有來自 cloudflare 配置的金鑰的憑證(有效):

ssl_certificate     /home/company/domain/ssl/push_node_cloudflare.pem;
ssl_certificate_key /home/company/domain/ssl/push_node_cloudflare_privatekey.key;

相關內容