Skip to content

Commit a755615

Browse files
author
Federico Ceratto
committed
Configure Nginx, minor changes
1 parent 4125e60 commit a755615

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
lines changed

ansible/deploy-haproxy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# See roles/haproxy/README.adoc
23
- hosts: have_haproxy
34
roles:
45
- role: haproxy

ansible/deploy-prio.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# See roles/haproxy/README.adoc
23
- hosts: have_prio
34
tasks:
45
- name: Add bintray pull-request repository

ansible/roles/haproxy/README.adoc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
HAproxy used for Orchestra / Prio
3+
4+
The [] box is the PS host
5+
probe --> [ nginx:443 --test-list--> haproxy:9972 --> orchestra ]
6+
[ ⤷ --> prio ]
7+
8+
Currently used only for /api/v1/test-list/urls
9+
Monitor with:
10+
ssh <probe service> -L 9972:127.0.0.1:9972
11+
browse http://localhost:9972/haproxy?stats
12+

ansible/roles/haproxy/templates/haproxy.cfg.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ frontend frontend_test_list_urls_forwarding
5555
bind 127.0.0.1:9972
5656
#http-response set-header Strict-Transport-Security max-age=63072000
5757
stats refresh 5s
58-
stats uri /haproxy?stats
58+
stats uri /haproxy_stats
5959
default_backend test_list_urls
6060

6161
backend test_list_urls

ansible/roles/probe-services/tasks/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- "blackhole_gateway is defined"
99

1010
- name: probe-services nginx config
11+
tags: probe-service-nginx-conf
1112
template: src=probe-services-nginx dest=/etc/nginx/sites-enabled/probe-services
1213
notify: reload nginx
1314

ansible/roles/probe-services/templates/probe-services-nginx

+30
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,21 @@ server {
9191
proxy_pass http://{{ registry_ipv4 }}:{{ registry_port }};
9292
}
9393

94+
# Prio / Orchestrate URL test list
95+
# Forwarded to Haproxy on localhost - see roles/haproxy/README.adoc
96+
# Should match:
97+
# - /api/v1/test-list/urls
98+
location /api/v1/test-list/urls {
99+
proxy_http_version 1.1;
100+
proxy_set_header Host $http_host;
101+
proxy_set_header X-Real-IP $remote_addr;
102+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
103+
proxy_set_header X-Forwarded-Proto $scheme;
104+
proxy_read_timeout 900;
105+
106+
proxy_pass http://127.0.0.1:9972;
107+
}
108+
94109
# Orchestrate
95110
# Should match:
96111
# - /api/v1/test-list
@@ -104,6 +119,7 @@ server {
104119

105120
proxy_pass http://{{ orchestrate_ipv4 }}:{{ orchestrate_port }};
106121
}
122+
107123
# - /api/v1/admin/jobs
108124
location ~^/api/v1/admin/(jobs|job) {
109125
proxy_http_version 1.1;
@@ -141,5 +157,19 @@ server {
141157
return 200 "{{ probe_services_domain }}";
142158
}
143159

160+
# Haproxy on localhost dashboard - see roles/haproxy/README.adoc
161+
# - /haproxy_stats
162+
location /haproxy_stats {
163+
proxy_http_version 1.1;
164+
proxy_set_header Host $http_host;
165+
proxy_set_header X-Real-IP $remote_addr;
166+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
167+
proxy_set_header X-Forwarded-Proto $scheme;
168+
proxy_read_timeout 900;
169+
170+
proxy_pass http://127.0.0.1:9972;
171+
}
172+
173+
144174
{{ c.location_letsencrypt() }}
145175
}

0 commit comments

Comments
 (0)