1

Apache rewrite condition to check whether request scheme is http or https is not working. I am running apache server behind loadbalancer(which is nginx server - ssl certificate is installed in loadbalancer). Mod_Rewrite variable %{HTTPS} is always comming as off for https request.

RewriteCond %{HTTPS} =on

But In servlet-container I am able to get request scheme which is also running behind same offloader.

Please let me know how to check wheather a request is http or https in apache and why ${HTTPS} is off in the above case.

Apacher Server Version: Apache/2.2.17 (Unix)

Cheran
  • 105
  • 1
  • 9
  • 1
    You will need to check `X-Forwarded-Proto`. This answer should lead you to the right rules: http://stackoverflow.com/questions/26620670/apache-httpx-forwarded-proto-in-htaccess-is-causing-redirect-loop-in-dev-envir – Michael Berkowski May 12 '16 at 12:57
  • @MichaelBerkowski thanks. – Cheran May 12 '16 at 16:21

0 Answers0