(https)Nginx->(http)播放!但是request.secure为false
|
将Nginx配置为Play前面的反向代理!并传递https
设置以下标头:-
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl https;
login()
[https://localhost/login
]正在转发给Play!在港口
9000为\'http \'。但是login()中的request.secure仍然为'false \'。任何想法 ?
更新:
这是服务器配置:
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate /home/aymer/play/key/localhost.crt;
ssl_certificate_key /home/aymer/play/key/localhost.key;
ssl_session_timeout 5m;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /home/aymer/play/playapp/public;
expires 30d;
}
location ~* (login|register)$ {
proxy_pass http://localhost:9000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
}
location / {
rewrite ^/(.*) http://$host/$1 permanent;
}
}
没有找到相关结果
已邀请:
3 个回复
拈吉勉犬姆
那将解决问题 更新:无法测试,我唯一缺少的是此标头:
除此之外,一切似乎都是正确的。
粳饶瓢部
参数
是没有用的(对于此用例)。 但是您还需要在application.conf中指定它:
这个答案只是Pere Villega和Aymer之间整个对话的回顾。
物崎巩
进入
“ 11”是server_name的值。