-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistencies with add www / strip www #312
Comments
fullyint++ for nice graph |
I think we want the
|
I hadn't thought we'd want any
I like the idea of thinking of it like toggles. Edit: I know there's plenty I don't understand about SSL, Strict-Transport-Security, etc. |
I still think we should be pushing our users towards HTTPS, and not allow the opposite. With https://letsencrypt.org/ around the corner, I think offering to downgrade connexions is not a good idea. Also, you would still need a Certificate to listen on the HTTPS port, because the redirect kick in only after the connexion is established. So it's a bad idea IMHO. |
Yeah they key to redirecting from The |
I see, thanks! Downgrading connections is bad practice and brings logistical problems with certs. |
We could automatically redirect the opposite of each item in host: www.example.com
has_www: "{{ host | match('^www\\.(.*)') }}" # returns true/false
www_removed: "{{ host | regex_replace('^www\\.(.*)', '\\\\1') }}" # returns hostname without www
host_to_redirect: "{{ has_www | bool | ternary(www_removed, 'www.' + host ) }}" We can't just put those variables in # roles/wordpress-setup/templates/wordpress-site.conf.j2
- {% for host in item.value.site_hosts if strip_www %}
+ {% for host in item.value.site_hosts if www_redirect %}
server {
{% if item.value.ssl is defined and item.value.ssl.enabled | default(false) -%}
listen 443 ssl spdy;
{% else -%}
listen 80;
{% endif -%}
- server_name www.{{ host }};
+ server_name {{ host | match('^www\\.(.*)') | ternary(host | regex_replace('^www\\.(.*)', '\\1'), 'www.' + host ) }};
return 301 $scheme://{{ host }}$request_uri;
}
{% endfor %} Users can turn off the automatic redirect by setting |
add_www/strip_www should also be ignored for subdomains |
Closed via #452 |
via @fullyint:
The text was updated successfully, but these errors were encountered: