Prestashop 8 docker with Apache reverse proxy

  • Obtain and configure cert stuff/DNS for your Apache frontend (reverse proxy) - prestashop.mydomain.com in our example
  • Configure and enable virtual hosts for http with https redirection and https at your Apache frontend (reverse proxy)
<VirtualHost *:80>
  ServerName prestashop.mydomain.com

  ProxyPreserveHost On
  ProxyPass / http://10.10.10.5/
  ProxyPassReverse / http://10.10.10.5/

  RewriteEngine on
  RewriteCond %{SERVER_NAME} =prestashop.mydomain.com
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} 
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerName prestashop.mydomain.com

  ProxyPreserveHost On
  ProxyPass / http://10.10.10.5/
  ProxyPassReverse / http://10.10.10.5/

  # Headers to manage reverse proxy
  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-Port "443"

  CustomLog ${APACHE_LOG_DIR}/prestashop_access.log vhost_combined
  ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log

  SSLCertificateFile /etc/letsencrypt/live/....
  SSLCertificateKeyFile /etc/letsencrypt/live/....

</VirtualHost>

 

  • Visit https://prestashop.mydomain.com and proceed with installation steps online. Select SSL enabled during setup.
    • If you skip/forget SSL, you can update database later:
      • Table ps_configuration
        • PS_SSL_ENABLED --> 1
        • PS_SSL_ENABLED_EVERYWHERE --> 1
  • That way, we manage to get proper access to admin and shop pages both, without any ERR_TOO_MANY_REDIRECTS problem