Springboot项目的nginx_https配置研究

近期研究了一下 springboot jsp web 项目的 https 部属,分享一下成果,代码见 https://gitee.com/feitian124/https_demo 准备工作 clone 并打包该项目, 以 war 包方式在 tomcat 中运行,访问 “http://localhost:8080/”, 可以看到网页内容 “welcome, now:14:05:23.489”。 新装 nginx, 访问 “http://localhost/", 可以看到 nginx 的欢迎页面。 80 端口访问项目首页 修改 nginx 如下配置, 可以 http 正常 80 端口访问项目首页了, 但 https 仍然不行。 location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } Nginx 配置 HTTPS Nginx 配置 HTTPS 并不复杂,主要有两个步骤:签署第三方可信任的 SSL 证书 和 配置 HTTPS...

September 24, 2020 · 2 分钟 · ming

spring官网推荐的学习项目sagan

spring 系框架如 spring, springboot, springcloud 等已成为 java 开发的标配,笔者也是 spring 系框架的多年用户,它们遵循统一的原则,原理清晰,实现优雅, 更新及时,很多最佳实践慢慢都沉淀为规则,为广大 javaer 提供了很多开箱即用的便利,大大降低开发成本。 官方网站一般是学习和查阅某种技术资料的首选, spring 也不例外. 前段时间,我惊喜的发现它们的官方网站 改版了, 风格更加清爽轻量,访问速度更快,布局更加条理找文档更加方便了。在这个前端框架层出不穷的年代,我有点好奇 spring 的官网前端和后端分别是用 啥做的, 又有啥亮点呢? 我们来一探究竟。 首页截图 分析网站技术架构有一个不错的工具 wappalyzer, 不过我们这里用不到,因为他家官网源码是开源的。 把源码 clone 下来,README 上面一开始就写着: In addition to the practical purpose of powering Spring’s home on the web, this project is designed to serve as a reference application– resource that developers can use to see how the Spring team have used Spring to implement a real-world app with a few interesting requirements....

May 26, 2020 · 2 分钟 · ming