nginx_redirect
Practical Ansible Nginx redirect
Define domain redirect on your Nginx. Useful when adding/removing from www.
from URL, useful when your domain has multiple aliases.
Example: Remove www.
- name: Configure redirect to remove www from URL
hosts: myhosts
become: yes
roles:
- role: practical-ansible.nginx_redirect
project_name: example
server_names: www.example.com
destination_domain: example.com
status: 301
Example: Redirect subdomain to a URL
- name: Configure redirect to remove www from URL
hosts: myhosts
become: yes
roles:
- role: practical-ansible.nginx_redirect
project_name: example
server_names: marketing-campaign.example.com
destination_url: example.com/landing-page
Install
ansible-galaxy install practical-ansible/nginx-redirect
License
Unknown
Downloads
353
Owner
Tiny Ansible roles and playbooks that help you with web hosting in a world of VPS