Handling X-FORWARDED-PROTO header in Java web application

前端 未结 2 393
感情败类
感情败类 2021-02-01 23:51

Can any one guide me in working with X-FORWARDED-PROTO header in Java web application deployed to Apache Tomcat.

The application setup is in such a way that tomcat talks

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 00:40

    Add this to your apache vhost managing connections

    
      ...
      RewriteEngine On
      RewriteCond %{HTTP:X-Forwarded-Proto} !https
      RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
    
    

    this assumes your health check is /status, which doesn’t require https

提交回复
热议问题