Add URL Redirection for websites
This commit is contained in:
		| @@ -22,6 +22,7 @@ Role Variables | |||||||
| * optional dictionary elements | * optional dictionary elements | ||||||
|   * aliases : list of alternative FQDN for the website |   * aliases : list of alternative FQDN for the website | ||||||
|   * proxy : URL to direct traffic for the FQDN to, e.g. http://localhost:8080 |   * proxy : URL to direct traffic for the FQDN to, e.g. http://localhost:8080 | ||||||
|  |   * redirect : Where should we send traffic? | ||||||
|  |  | ||||||
| ~~~ | ~~~ | ||||||
| lets_encrypt_admin: 'acme@example.com' | lets_encrypt_admin: 'acme@example.com' | ||||||
|   | |||||||
| @@ -27,6 +27,9 @@ MDStoreDir md | |||||||
| {% endif %} | {% endif %} | ||||||
|   ServerAdmin webmaster@{{ item.fqdn }} |   ServerAdmin webmaster@{{ item.fqdn }} | ||||||
|   DocumentRoot /srv/http/{{ item.fqdn }} |   DocumentRoot /srv/http/{{ item.fqdn }} | ||||||
|  | {% if item.redirect is defined %} | ||||||
|  |   Redirect temp {{ item.redirect }} | ||||||
|  | {% endif %} | ||||||
| </VirtualHost> | </VirtualHost> | ||||||
|  |  | ||||||
| MDomain {{ item.fqdn }} | MDomain {{ item.fqdn }} | ||||||
| @@ -54,6 +57,9 @@ MDomain {{ item.fqdn }} | |||||||
|   ProxyPass "/" "{{ item.proxy }}" |   ProxyPass "/" "{{ item.proxy }}" | ||||||
|   ProxyPassReverse "/" "{{ item.proxy }}" |   ProxyPassReverse "/" "{{ item.proxy }}" | ||||||
|   ProxyTimeout 300 |   ProxyTimeout 300 | ||||||
|  | {% endif %} | ||||||
|  | {% if item.redirect is defined %} | ||||||
|  |   Redirect temp {{ item.redirect }} | ||||||
| {% endif %} | {% endif %} | ||||||
|   <Location /.git> |   <Location /.git> | ||||||
|     Require all denied |     Require all denied | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user