使用tomcat或者weblogic部署的应用默认都是http访问的,如果通过https访问,需要ssl证书。tomcat或者weblogic可以配置;
同时,另一种方法,https网站中,如果接口服务是http的,那么请求接口就会被拒绝,可以使用nginx做代理转发访问。
1.进入源码包
cd /root/nginx-1.22.0
编译
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
2.配置完成后,运行命令:
make
!!!使用make,切记不要执行make install
3.停止nginx
/usr/local/nginx/sbin/nginx -s stop
4.备份原有已安装好的nginx并替换
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bakcp /root/nginx-1.22.0/objs/nginx /usr/local/nginx/sbin
5.重启nginx
/usr/local/nginx/sbin/nginx
Nginx的安装和配置_大宇进阶之路的博客-CSDN博客_nginx默认安装目录
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout server.key -out server.crt
这里使用的是https的默认端口443(http的默认端口是80),也可以修改为其他端口
server {listen 443 ssl;server_name localhost;ssl_certificate /usr/local/nginx/conf/cert/server.crt;ssl_certificate_key /usr/local/nginx/conf/cert/server.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;location / {root html;proxy_pass http://localhost:8080;index index.html index.htm;}}
nginx配置自签名https_彼岸-花已开的博客-CSDN博客_nginx 配置cer证书
上一篇:充满阳光正能量的句子
下一篇: 普通员工身体原因辞职报告