Hi folks, I have it up and running on Kubernetes (AKS - AZURE) and I would be more than happy to write an article to help everyone else to do the same.
There is one small and annoying issue to take care of first, during the installation at the end of each stage it would redirect back to the http version of the address instead of keeping the https, upon adding the “s” and reloading the page I was able to just continue the installation.
I have found so far that whenever a user is created or logs out it also redirects to http instead of https, adding the “s” and reloading takes care of it, so far I haven’t found any other operations that would cause the redirection, but I assume that they are there, just waiting to bite me.
It currently sits behind an Application Gateway with WAF on it, which is rock solid (there are 200 applications running on the AKS Cluster on https at the moment), so no problems in the K8s side of things.
Long story short, after trying for 2 days and not being able to access it, then not going past the first installation steps and going through tons of different posts on the internet, this is what I was able to find to configure it, and get it to the stage where it is now:
mkdir -p /opt/drupal/web/sites/default/files mkdir -p /opt/drupal/web/sites/default/private/files chown -R www-data:www-data /opt/drupal/web/sites/default/private/ chown -R www-data:www-data /opt/drupal/web/sites/default/files chmod 770 /opt/drupal/web/sites/default/private/files chmod 770 /opt/drupal/web/sites/default/files chown -Rv apache:apache www-data:www-data /opt/drupal/web/sites/ cp /opt/drupal/web/core/assets/scaffold/files/default.settings.php /opt/drupal/web/sites/default/default.settings.php chown www-data:www-data /opt/drupal/web/sites/default/default.settings.php cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/default/settings.php chown www-data:www-data /opt/drupal/web/sites/default/settings.php echo "\$settings['reverse_proxy'] = TRUE;" >> /opt/drupal/web/sites/default/settings.php echo "\$settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL;" >> /opt/drupal/web/sites/default/settings.php echo "\$settings['file_private_path'] = '/opt/drupal/web/sites/default/private/files';" >> /opt/drupal/web/sites/default/settings.php echo "\$config['system.logging']['error_level'] = 'verbose';" >> /opt/drupal/web/sites/default/settings.php echo "\$settings['clean_url'] = 1;" >> /opt/drupal/web/sites/default/settings.php echo "\$base_url = 'https://mysite-my.example.com';" >> /opt/drupal/web/sites/default/settings.php # Adding the PHP script to handle X-Forwarded-Proto header echo "if (isset(\$_SERVER['HTTP_X_FORWARDED_PROTO']) && \$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { \$_SERVER['HTTPS'] = 'on'; }" >> /opt/drupal/web/sites/default/settings.php awk '/<IfModule mod_rewrite.c>/ { print; print "# Ensure HTTPS for all requests\nRewriteEngine On\nRewriteCond %{HTTP:X-Forwarded-Proto} !https\nRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]"; next }1' /opt/drupal/web/.htaccess > /opt/drupal/web/.htaccess.new && mv /opt/drupal/web/.htaccess.new /opt/drupal/web/.htaccess
So basically I covered settings.php and .htaccess, if anyone has a hint on why the redirections to http are happening, I would appreciate the help.
FarmOS image 2.1.1