前言:
眼前小伙伴们对“nginx多个ssl”可能比较讲究,兄弟们都需要知道一些“nginx多个ssl”的相关知识。那么小编同时在网上收集了一些对于“nginx多个ssl””的相关文章,希望兄弟们能喜欢,咱们快快来学习一下吧!######################## 配置Nginx负载均衡,可以配置多个节点 以及各个节点的权重和超时时间 ############################
upstream www {
server 172.16.2.6:8080 weight=10 max_fails=3 fail_timeout=30s;
#server 172.16.2.7:8080 weight=10 max_fails=3 fail_timeout=30s;
server 172.16.2.2:8080 weight=10 max_fails=3 fail_timeout=30s;
#keepalive 500;
}
######################## 配置Nginx监听443端口 ############################
server {
listen 443;
server_name xxx.xx.com;
######################## 配置Nginx访问正常的日志 ############################
access_log /home/log/nginx/xxx.xxx.com_nginx.log;
######################## 配置Nginx访问错误的异常日志 ############################
error_log /home/log/nginx/xxx.xx.com_nginxerror.log;
#root /data/wwwroot/default;
#index index.html index.htm index.php;
#error_page 404 /404.html;
#error_page 502 /502.html;
######################## 配置Nginx SSL即Https 证书 ############################
ssl on;
ssl_certificate /usr/local/nginx/conf/ssl/xx.com/xxx.com.pem;
ssl_certificate_key /usr/local/nginx/conf/ssl/xx.com/xxx.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.2;
ssl_prefer_server_ciphers on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
######################## 配置Nginx 反向代理到后端服务 ############################
location / {
proxy_pass ;
expires 30d;
#limit_req zone=one;
proxy_connect_timeout 300s;
#proxy_http_version 1.1; # 后端配置支持HTTP1.1,必须配
#proxy_set_header Connection ""; # 后端配置支持HTTP1.1 ,必须配置。
}
location /favicon.ico {
#root '/data/web/static/';
return 404;
}
location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
######################## 配置Nginx监听80端口然后强制重定向到443端口 ############################
server {
listen 80;
server_name xxx.xxx.com;
rewrite ^(.*)$ permanent;
}
标签: #nginx多个ssl