在反向代理/負載均衡器後面構建web應用程序,我需要獲取請求的正確原始URL(預負載平衡器重寫)。Restlet如何建立與HATEAOS的鏈接正確?
我已經使用getReference()(在ServerResource中)在HATEAOS意義上添加自引用。但是文檔說getReference()可以被路由操縱,並且當前它不包含正確的方案(http,而不是https - 負載平衡器終止https)。
以下是關於轉發頭文件的NGINX配置。
location /api {
proxy_pass http://test-service;
proxy_pass_header X-Host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X_FORWARDED_PROTO $scheme;
}
反向代理配置不正確,還是應該使用getOriginalReference()方法。是否有一些文檔解釋瞭如何構建「原始」引用,哪些字段用於反向代理。