Tell that it is SSL communication from the reverse proxy

Set the X-Forwarded-HTTPS request header to tell Mojolicious that SSL communication is taking place when using a reverse proxy.

The following is an example of Apache.

<VirtualHost *: 443>
   <Proxy *>
     Order deny, allow
     Allow from all
   ProxyRequests Off
   ProxyPreserveHost On
   ProxyPass / http: // localhost: 20000 / keepalive = On
   ProxyPassReverse / http: // localhost: 20000 /
   RequestHeader set X-Forwarded-HTTPS "1"

If you do this, Mojolicious will recognize that you are communicating with the https schema, and the url_for method etc. will correctly draw the https schema.

Associated Information