haproxy RewriteRule.
This commit is contained in:
parent
e97acbeafb
commit
f8f2047872
4 changed files with 27 additions and 0 deletions
18
playbooks/groups/proxies-haproxy.yml
Normal file
18
playbooks/groups/proxies-haproxy.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
- name: Set up all the haproxy stuff.
|
||||
hosts: proxies-stg
|
||||
user: root
|
||||
gather_facts: True
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "{{ private }}/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
handlers:
|
||||
- include: "{{ handlers }}/restart_services.yml"
|
||||
|
||||
roles:
|
||||
|
||||
- role: haproxy/rewrite
|
||||
website: admin.fedoraproject.org
|
||||
path: /haproxy
|
|
@ -82,4 +82,5 @@
|
|||
- include: proxies-reverseproxy.yml
|
||||
- include: proxies-redirects.yml
|
||||
- include: proxies-fedora-web.yml
|
||||
- include: proxies-haproxy.yml
|
||||
- include: proxies-miscellaneous.yml
|
||||
|
|
6
roles/haproxy/rewrite/tasks/main.yml
Normal file
6
roles/haproxy/rewrite/tasks/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- template: src=rewrite.conf dest=/etc/httpd.conf.d/{{website}}/haproxy.conf
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- haproxy
|
||||
- haproxy/rewrite
|
2
roles/haproxy/rewrite/templates/rewrite.conf
Normal file
2
roles/haproxy/rewrite/templates/rewrite.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
RewriteEngine On
|
||||
RewriteRule ^{{path}}/(proxy\d+)((?:;.*)?) http://$1:8080/$2 [P,L]
|
Loading…
Add table
Add a link
Reference in a new issue