关于linux openssl的自签证书认证与nginx配置

自签文档链接

重点注意这块,不能写一样的,要是一样的话登录界面锁会报不安全

域名这块跟最后发布的一致

nginx配置的话

java 复制代码
 server {
		listen       443 ssl;		//ssl 说明为https  默认端口为443
        server_name  www.skyys.com;  //跟openssl设置的域名保持一致

        ssl_certificate /root/CA/root/server.crt;	//这里是签证位置
        ssl_certificate_key /root/CA/root/server.key; //这里是key
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout  10m;
        ssl_ciphers HIGH:!aNULL:!MD5;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;
			
        
		
//转到83 https转到http,这样后端如果无别的长链接的话就可直接用,
//后端不用转https了;如果后端有websocket的话得在nginx配置才行,访问为 wss:
		location / {
			proxy_pass http://192.168.254.136:83;
		}
    }
    
    server {
        listen       83;
        server_name  _;
        location / {
				root    	/usr/local/src/lhd/dist;
				index 		index.html index.htm;
			}

        ssl_prefer_server_ciphers on;

			location ^~/api {

			rewrite ^/api/(.*)$ /$1 break; 
			proxy_pass http://192.168.254.86:9124;
		}
    }
相关推荐
未济13 小时前
linux 配置环境变量
linux
傲世仙尊13 小时前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫13 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
还是大剑师兰特14 小时前
解决nginx错误:http://localhost:7000正常,http://localhost:7000/map 报错404
nginx·大剑师
_艾伦 耶格尔.15 小时前
进程间通信
linux
AI职业加油站15 小时前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-0515 小时前
Linux IO编程——静态库、动态库
linux
此冬歌咏16 小时前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz16 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
xing-xing16 小时前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker