/etc/nginx/conf.d/test1.conf
server {
listen 443 ssl;
server_name test1.pank.org;
ssl_certificate /etc/nginx/conf.d/pank.org-crt-chain.pem;
ssl_certificate_key /etc/nginx/conf.d/pank.org-key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
server_name test1.pank.org;
ssl_certificate /etc/nginx/conf.d/pank.org-crt-chain.pem;
ssl_certificate_key /etc/nginx/conf.d/pank.org-key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
add_header X-Proxy-Cache $upstream_cache_status;
proxy_pass http://192.168.0.27;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.0.27;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}若後端有多台,建立多個 conf 即可
有設定 proxy_set_header X-Forwarded-For 會帶 X-Forwarded-For 到 backend server
沒有留言:
張貼留言