Web-opt-rdr-www Role¶
Description: No description available
Variables¶
author: Kevin Veen-Birkenbach
description: An Ansible role to redirect www subdomains to bare domains (apex). Supports Cloudflare edge redirects or local Nginx redirects.
license: Infinito.Nexus NonCommercial License
license_url: https://s.infinito.nexus/license
company: Kevin Veen-Birkenbach
Consulting & Coaching Solutions https://www.veen.world
min_ansible_version: 2.9
platforms: [{‘name’: ‘Archlinux’, ‘versions’: [‘rolling’]}]
galaxy_tags: [‘nginx’, ‘redirect’, ‘www’, ‘cloudflare’, ‘seo’]
repository: https://s.infinito.nexus/code
issue_tracker_url: https://s.infinito.nexus/issues
documentation: https://docs.infinito.nexus
README¶
Nginx WWW Redirect 🌐¶
Description¶
Automates the creation of Nginx server blocks that redirect all www.
subdomains to their non-www equivalents. Simple, idempotent, and
SEO-friendly! 🚀
Overview¶
*.conf vhosts in your
Nginx servers directoryDOMAIN_PRIMARYweb-opt-rdr-domains roleAll tasks are guarded by “run once” facts and MODE_CLEANUP flags to
avoid unintended re-runs or stale files.
Purpose¶
Ensure that any request to www.example.com automatically and
permanently redirects to https://example.com, improving user
experience, SEO, and certificate management. 🎯
Features¶
Auto-Discovery: Scans your Nginx
serversdirectory for.conffiles. 🔍Dynamic Redirects: Builds
source: "www.domain"→target: "domain"mappings on the fly. 🔧Wildcard Redirect: Includes a templated wildcard server block for
www.*domains (toggleable). ✨Cleanup Mode: Removes the wildcard config file when
CERTBOT_FLAVORis set todedicatedandMODE_CLEANUPis enabled. 🗑️Debug Output: Optional
MODE_DEBUGgives detailed variable dumps for troubleshooting. 🐛