关于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;
		}
    }
相关推荐
orion5716 小时前
Missing Semester Class1:course overview and introduction of shell
linux
SkyWalking中文站20 小时前
认识 Horizon UI · 6/17:Trace 探索器
运维·监控·自动化运维
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
火车叼位1 天前
写给初级开发者:SSL、SSH、HTTPS 与证书体系全解析
运维
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
小猿姐1 天前
唯品会大规模数据库云原生实践:基于 KubeBlocks 管理数千实例的统一运维之路
运维·elasticsearch·云原生
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
SkyWalking中文站2 天前
认识 Horizon UI · 5/17:3D 基础设施地图
运维·监控·自动化运维
tntxia3 天前
linux curl命令详解_curl详解
linux