apacheamazon-web-servicesload-balancingelastic-load-balancermod-speling

Force mod_speling to use https


We are using the mod_speling in one of our projects which worked fine for years. However, recently we have moved to AWS cloud and hidden our instances behined an elastic load balancer. As the load balancer behaves as a reverse proxy, it also terminates SSL traffic. However, mod_speling doesn't know that and if there's a spelling issue to fix, it redirects a request to http:// instead of https:// .

How can I force mod_speling to use https? I've X_FORWARDED_* flags set and HTTPS set to "on" as well. The mod probably uses a SCRIPT_URI flag, but I'd rather not overwrite it as it doesn't feel like a good way to do this.

We are using Apache 2.4.

Thanks!


Solution

  • Enforce the schema (https) via your ServerName at your vhost, it will work as long as you are browsing via balancer which terminates SSL.

    ServerName https://www.example.com
    

    See more about ServerName directive