1、在nginx安装目录下创建cert目录并将.pem和.key的证书拷贝到该目录下
.crt文件:是证书文件,crt是pem文件的扩展名。
.key文件:证书的私钥文件
配置文件:
worker_processes auto;
worker_cpu_affinity auto;
error_log /var/log/nginx/error.log crit;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stram;
server_tokens off;
server_names_hash_bucket_size 64;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/x-shockwave-flash image/png image/x-icon image/gif image/jpeg;
gzip_buffers 16 8k;
upstream yx {
server 172.168.2.234:8080 weight=1;
session_sticky;
}
#重定向
server {
listen 80;
server_name yxlx.hufe.edu.cn;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
#配置上文的80监听这一行不用配
listen 80;
listen 443 ssl;
server_name yxlx.hufe.edu.cn;
ssl_certificate /usr/nginx/cert/star_hufe_edu_cn.pem;
ssl_certificate_key /usr/nginx/cert/myprivate_ov.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location /zhxy {
proxy_pass http://172.168.2.234:6080;
include proxy.conf;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ^~ /WEB-INF {
deny all;
}
}
}
2、在tomcat 的server.xml文件中的 Engine 模块下配置一个 Valve:
<Valve className="org.apache.catalina.valves.RemoteIpValve"
remoteIpHeader="X-Forwarded-For"
protocolHeader="X-Forwarded-Proto"
protocolHeaderHttpsValue="https"/>
分享到:
相关推荐
里面 1.7.4 的nginx https 的配置 下载下来后 需要配置一下 nginx 的配置文件即可
nginx图片服务器配置和https配置
linux下nginx配置ssl,配置内网ip访问,配置内网域名访问。配置相同网站http重定向到https
Windows下Nginx配置SSL实现Https访问(包含证书生成)
nginx配置+https
NULL 博文链接:https://sakajiaofu.iteye.com/blog/1895262
网络上很难找到非常详细的...本文档通过真实的实践经验,从安装OpenSSL和Nginx,到利用openssl生成证书,配置nginx的https(包括配置http请求转发到https)等,详细总结出nginx配置https的步骤,最终能帮助你配置成功。
nginx配置 +负载均衡+https协议 完整的配置以及nginx 启动 停止 重新加载
weblogic集群安装及nginx https反向代理及负载均衡配置
Nginx配置http转https以及https访问http静态资源.docx
nginx.conf nginx-1.20.1.tar.gz 这是关于centos8的nginx 和nginx 的配置https文件
nginx配置https ssl 安全协议nginx配置https ssl 安全协议
现在的网站支持Https几乎是标配功能,Nginx能很好的支持Https功能。下面列举一个配置同时...废话不多说,下面直接贴一个Nginx支持Http和Https的配置,是我的wordpres网站支持Https的配置,大家何以参考。 server { #
nginx配置https反向代理到tomcat的http,包括windows版本和linux版本的软件下载,安装,配置等
nginx https、反向代理
提供了小程序https服务在nginx环境下的配置示例,包括https配置和小程序扫二维码打开小程序时需要在nginx服务端放置小程序二维码扫描校验文件的配置
主要介绍了Nginx配置SSL自签名证书的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Vue项目结果build编译后,放在Nginx的html文件夹内,替换该配置文件,就可以在Nginx服务器上运行Vue项目
对nginx转发配置参考,nginx转发,Windows下开机自启动,将Nginx转换为Windows服务,这样就可以在开机时自动启动Nginx了。
https://download.csdn.net/download/wz15634421466/10267200