What's the de facto standard for a Reverse Proxy to tell the backend SSL is used?

后端 未结 2 1710
旧巷少年郎
旧巷少年郎 2020-12-02 10:44

I have a reverse proxy that does HTTPS on the outside, but HTTP on the inside.

This means that by default in-app URLs will have HTTP as the scheme, as this is the wa

2条回答
  •  孤城傲影
    2020-12-02 11:17

    It took me several hours of googling to find the magic setting for my environment. I have a SSL httpd Apache reverse proxy in front of a jetty app server and an apache2 http server. This answer actually gave me the information that worked. For me, adding:

    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
    

    to the site conf file was enough for the destination to use https instead of http as the protocol when building links in the response. I tried the X-FORWARDED-PROTOCOL above, but that didn't work. Hopefully this will help in future Google searches!

提交回复
热议问题