我打通正在執行SSL終止和發送解密的流量到我的服務器的端口負載平衡器我SSL請求81.如何在Nginx的配置SSL終止與Rails應用程序
我運行Nginx的和已經設置了端口81的偵聽器,我想告訴我的Rails應用程序這是一個SSL請求。
這裏是我的Nginx的配置看起來像:
server {
listen 81;
server_name SERVER;
root /var/www/app/current/public;
error_log /var/log/nginx/app-error.log;
access_log /var/log/nginx/app-access.log;
passenger_enabled on;
client_max_body_size 100M;
location/{
passenger_enabled on;
proxy_set_header X-FORWARDED-PROTO https;
}
}
它經歷,但Ruby on Rails的不檢測頭request.headers [「X - 轉發,原」],所以它需要的請求爲非https。 爲了讓Rails認爲這是一個SSL請求,我應該添加什麼?