Tomcat等代理服务器运行时启用HTTPS

讨论 0 463
s03l4
s03l4 LV1 2021年5月19日 11:32 发表
点击群号免费加入社区交流群:367346704
<p>Tomcat等代理服务器运行时启用HTTPS:</p><pre><code>server.tomcat.remote-ip-header=x-forwarded-for<br>server.tomcat.protocol-header=x-forwarded-proto</code></pre><pre><code>@Configuration(proxyBeanMethods = false)<br>public class SslWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {<br> <br> @Override<br> protected void configure(HttpSecurity http) throws Exception {<br> // Customize the application security<br> http.requiresChannel().anyRequest().requiresSecure();<br> }<br> <br>}</code></pre><p><br></p>
收藏(1)  分享
相关标签: Tomcat
0个回复
  • 消灭零回复