最近有不少用户问到不会用nginx代理离线下载应用,追加ssl,现在720云小伙伴推出该代理参考配置模板以供使用
代码如下:
server {
# 如果使用https请讲将80端口配置注释,取消443端口注释
listen 80;
#listen 443 ssl;
#填写本地指定域名,默认可直接本地地址访问
server_name _;
#以下使用https配置,使用取消注释,ssl_certificate为证书crt文件路径,ssl_certificate_key为证书key文件路径
#如果配置ssl尽量参考证书供应商提供配置替换以下注释内容
#ssl_certificate ;
#ssl_certificate_key ;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_prefer_server_ciphers on;
#ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:!ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:!RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH;
#ssl_session_cache shared:WEB:512m;
#ssl_session_timeout 180m;
#ssl_session_tickets on;
#ssl_stapling on;
#add_header Strict-Transport-Security "max-age=0";
location / {
#如果修改离线下载应用端口,则需修改以下对应端口
proxy_pass http://127.0.0.1:10000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}