推荐产品
- IoT设备证书自建PKI与第三方CA怎么选?越来越多企业选了第三条路
- 用户一看到“未知发布者”就关掉?先搞清楚 OV 和 EV 的区别
- 子域名越多证书越难管?沃通 CertBot 加沃通 CaaS 才是完整解法
- 驱动签名证书过期了?旧驱动不用重签,WHQL也不用重做
- Windows 总提示“已保护你的电脑”?别急着点“仍要运行”,先做三件事
- 为了申请HTTPS专门买个域名?其实SSL证书可以直接签给IP
- 小程序突然打不开?先别查服务器,大概率是SSL证书过期了
- SSL 证书有效期已缩至 199 天,还在手动续签的团队该换自动化了
- 域名验证≠身份验证:企业SSL证书选型指南
- 从 DV 到 OV,我们花了一年多才补上金融安全这一课
nginx配置反代理协议和SSL证书
nginx配置反向代理,负载均衡配置;
upstreamqq_com {
ip_hash;
server127.0.0.1:8080;
server127.0.0.1:8081;
}
server {
listen80;
server_namewww.qq.com;
location/
{
proxy_passhttp://qq_com;
proxy_set_headerHost$host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;
}
}
nginx 配置SSL
server
{
listen443;
server_namea.com;
indexindex.htmlindex.php;
root/data/nginx/a.com;
sslon;
ssl_certificatecert/215058855400123.pem;
ssl_certificate_keycert/215058855400123.key;
ssl_protocolsTLSv1TLSv1.1TLSv1.2;
location/{
root/home/www/a.com;
indexindex.htmlindex.htm;
}
access_log/tmp/1.logcombined_realip;
}
nginx 配置静态目录
server{
listen8088;
server_namelocalhost;
#charsetkoi8-r;
#access_loglogs/host.access.logmain;
location~.*\.(gif|jpg|jpeg|png)${
expires24h;
rootusr/local/image/;#指定图片存放路径
access_logusr/local/image/images.log;#日志存放路径
proxy_storeon;
proxy_store_accessuser:rwgroup:rwall:rw;
proxy_temp_pathsr/local/image/;#图片访问路径
proxy_redirectoff;
proxy_set_headerHost127.0.0.1;
client_max_body_size10m;
client_body_buffer_size1280k;
proxy_connect_timeout900;
proxy_send_timeout900;
proxy_read_timeout900;
proxy_buffer_size40k;
proxy_buffers40320k;
proxy_busy_buffers_size640k;
proxy_temp_file_write_size640k;
if(!-e$request_filename)
{
proxy_passhttp://127.0.0.1;
}
}
nginx 用户认证
server
{
listen80;
server_nametest.com;
index index.htmlindex.htmindex.php;
root/data/wwwroot/test.com;
location/
{
auth_basic”Auth”;
auth_basic_user_file/usr/local/nginx/conf/htpasswd;
}
}
yuminstall-yhttpd
htpasswd-c/usr/local/conf/htpasswdaming
./nginx-sreload
