We are redirecting non-www
to www
because non-www
is in use by client intranet.
Provision is failing at TASK [letsencrypt : Test Acme Challenges]
because DNS for example.com
points to a different IP address than hosting server.
I think that the final result nginx config files should look something like:
server {
#listen 80 is default
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
server_name www.example.com;
#The rest of your configuration goes here#
}
Would it make sense to to skip letsencrypt for the non-www
domain listed under the site_hosts:redirects
?
"site_hosts": [{"canonical": "www.example.com", "redirects": ["example.com"]}]
Is this something that would be done in the task that’s breaking?
- name: Test Acme Challenges
test_challenges:
hosts: "{{ site_hosts }}"
register: letsencrypt_test_challenges
ignore_errors: true
when: site_uses_letsencrypt
with_dict: "{{ wordpress_sites }}"
Perhaps the solution is to add a when
clause, but I’m not sure how to reference the {{ site_hosts }}
dict contents.
Can one of you wonderful (and healthy, I hope) developers enlighten me?
Thanks a lot.