server {
# 服务器端口使用443,开启ssl, 这里ssl就是上面安装的ssl模块
listen 443 ssl;
# 域名,多个以空格分开
server_name 192.168.100.100;
# ssl证书地址
ssl_certificate /home/bigdata/server.crt; # pem文件的路径
ssl_certificate_key /home/bigdata/server.key; # key文件的路径
# ssl验证相关配置
ssl_session_timeout 5m; #缓存有效期
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #加密算法
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #安全链接可选的加密协议
ssl_prefer_server_ciphers on; #使用服务器端的首选算法
location / {
root /home/bigdata/safe_ferry/dist/spa;
index index.html index.htm;
}
location ^~/template/ {
rewrite ^/template/(.*)$ /$1 break;
proxy_pass https://192.168.101.61:8080/; #后台IP
}
}
server {
listen 80;
server_name 192.168.100.100;
return 307 https://$server_name$request_uri;
}
|