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>
   ServerName some.com
   <Proxy *>
     Order deny, allow
     Allow from all
   </Proxy>
   ProxyRequests Off
   ProxyPreserveHost On
   ProxyPass / http: // localhost: 20000 / keepalive = On
   ProxyPassReverse / http: // localhost: 20000 /
   RequestHeader set X-Forwarded-HTTPS "1"
</VirtualHost>

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