Tomcat等代理服务器运行时启用HTTPS
<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)
分享
相关标签: