1 启动tomcat
service tomcat8 start
查看8080端口的java进程
通过ip/域名加 8080 端口,查看到tomcat 页面
查看日志信息,tomcat日志地址及查看指令
-
2 启动nginx
-
3 配置nginx 证书
-
-server下配置内容(配置文件路径 )
listen 443;
server_name localhost;
ssl on;root /var/lib/tomcat8/webapps; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; ssl_certificate /etc/nginx/certs/a.pem; ssl_certificate_key /etc/nginx/certs/a.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { root /var/lib/tomcat/webapps; index index.html index.htm; }
检查443端口号
通过https访问,检查证书是否配置成功。
- 4 将443 端口映射到 8080端口
- 添加端口转发配置
proxy_set_header Host $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
- 4 通过https协议访问tomcat下java 应用
熟悉的It works 2222:!
查看端口使用情况
谢谢观看,希望对大家有用!