nginx
ubuntu
整理環境でよく使われるnginx
コマンドとnginx.conf
設定リンク:http://nginx.org/en/docs/http/ngx_http_proxy_module.html
2.リバースエージェントを使用する場合のクッキーの使用方法
server {
...
location / {
# 요기부터
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass <url>
# 요기까지 추가하면 됨
proxy_redirect off;
}
...
ここのポイントはusing secure sessions behind an http proxyこのリンクがよく説明されています.コアは
proxy_set_header X-Forwarded-Proto $scheme
Why does this matter? Isn’t everything is served via https anyway?Of course, but everything is also served via an ELB which proxies to our nginx cluster, which in turn proxies to our apps servers via internal http connections. The fix is trivial as it’s easy to set/modify headers in nginx, making the header validation in Connect quite pointless – proxy_set_header x-forwarded-proto https;.
In completely unrelated news, sessions on GoSquared now use secure + httponly cookies!
PS. remember to add proxy_set_header Host $host; too if you need the host header to be forwarded too, it appears to get lost otherwise.
内部エージェントはhttpconnectionです.したがって、cookie secureを実装するには、proxy set headerx-predired-proto httpsを設定する必要があります.また、host headerを渡すにはproxy set headerhost$hostを設定する必要があります.
3.右奮闘でよく使われるnginx command line
エラーログは
nginx
プロファイルに表示され、ログがどこに蓄積されているかが表示されます.コメントリンク
Reference
この問題について(nginx), 我々は、より多くの情報をここで見つけました https://velog.io/@broccoliindb/nginxテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol