美文网首页
spring-boot ssl

spring-boot ssl

作者: canezk | 来源:发表于2016-11-28 16:46 被阅读171次
最近服务需要从http增加对https的支持,于是做点研究

简介

服务采用nginx反向代理+tomcat做web container

方案

  1. nginx层,需要增加支持
ssl                  on;
    ssl_certificate      xxx;
    ssl_certificate_key  xxx;

    listen       443;
    ssl_session_timeout  5m;
    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers   on;

注意:nginx可以同时支持http和https两种协议

  1. tomcat增加支持(spring boot内置的)
server.tomcat.remote_ip_header=x-forwarded-for
server.tomcat.protocol_header=x-forwarded-proto
server.tomcat.port-header=X-Forwarded-Port
server.use-forward-headers=true

参考

https rfc
spring-boot tomcat配置ssl

相关文章

网友评论

      本文标题:spring-boot ssl

      本文链接:https://www.haomeiwen.com/subject/humopttx.html