您的位置:首页 > 运维架构 > Nginx

Nginx 示例

2022-04-13 20:56 661 查看 https://www.cnblogs.com/ysmc/p
server {
listen 80;
server_name demo.nrst.top;
rewrite ^(.*)$ https://${server_name}$1 permanent;
}

server {
listen 443 ssl;  # 1.1版本后这样写
server_name demo.nrst.top; #填写绑定证书的域名
ssl_certificate ssl/demo.nrst.top.pem;  # 指定证书的位置,绝对路径
ssl_certificate_key ssl/demo.nrst.top.key;  # 绝对路径,同上
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
ssl_prefer_server_ciphers on;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:55328;
}

location /chatHub {
proxy_http_version 1.1;
proxy_cookie_path /project /proxy_path;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://localhost:55328/chatHub;
}
}

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: