关于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;
		}
    }
相关推荐
啊吧怪不啊吧1 小时前
UU远程协助迎来升级!第一期更新实测
运维·服务器·远程工作
C_心欲无痕7 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6008 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston8 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20189 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟9 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston9 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式9 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
码农小韩10 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法
wdfk_prog11 小时前
[Linux]学习笔记系列 -- [fs]seq_file
linux·笔记·学习