Hi,
Last week we migrated our site from Amazon to Google Cloud using Trellis, after testing on a GC staging environment. Everything seemed to be fine, including the automatic redirect in the browser from australiascience.tv to https://australiascience.tv. I’m pretty sure I tested this after clearing out the caches in both browsers.
This morning, however, I’m finding that in both FF and Chrome, after clearing the browser cache, both our staging URL and our Production URL time out (ERR_CONNECTION_TIMED_OUT), i.e. they do not redirect and users must explicitly type https://australiascience.tv into their browsers.
I found this thread, https://discourse.roots.io/t/problems-with-com-au-domains/6680/4, and am wondering if it has something to do with our unusual TLD, “.tv”. However, the suggested fix doesn’t help, since my lib/trellis/plugins/filter/filters.py looks like this:
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function, unicode_literals)
__metaclass__ = type
import types
from ansible import errors
from ansible.module_utils.six import string_types
def to_env(dict_value):
envs = ["{0}='{1}'".format(key.upper(), str(value).replace("'","\\'")) for key, value in sorted(dict_value.items())]
return "\n".join(envs)
def underscore(value):
''' Convert dots to underscore in a string '''
return value.replace('.', '_')
class FilterModule(object):
''' Trellis jinja2 filters '''
def filters(self):
return {
'to_env': to_env,
'underscore': underscore,
}
i.e. there is no test on the length of the hostname.
On the server, I’ve also had a look at /etc/nginx/sites-enabled/australiascience.tv.conf, but am uncertain what (if anything) to change).
Meanwhile, here is our group_vars/production/wordpress_sites.yml:
# Documentation: https://roots.io/trellis/docs/remote-server-setup/
# `wordpress_sites` options: https://roots.io/trellis/docs/wordpress-sites
# Define accompanying passwords/secrets in group_vars/production/vault.yml
# See also docs on SSL: https://roots.io/trellis/docs/ssl/
# SSL provider is https://www.geotrust.com/
wordpress_sites:
australiascience.tv:
site_hosts:
- canonical: australiascience.tv
redirects:
- www.australiascience.tv
local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
repo: git@gitlab.com:australiasciencechannel/wordpress.git # replace with your Git repo URL
# repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo
branch: wordpress-sprint1
multisite:
enabled: false
ssl:
enabled: true
provider: manual
cert: ~/ssl/australiascience.tv.crt
key: ~/ssl/australiascience.tv.key
cache:
enabled: true
# We point the database to Google Cloud SQL. This db_user's password should be
# env.db_password, as defined in vault.yml
db_create: false
env:
db_name: australiascience_production
db_user: australiascience
db_host: 35.189.40.22
Finally, a colleague has noted that on Apache we would have made the following updates:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://australiascience.tv/$1 [R,L]
but since this is an Nginx server we’re not sure how to replicate that configuration.
Do you have any advice for us? We would be grateful for any assistance!