Skip to content

Commit b852f24

Browse files
committed
added upstreams to demo config
1 parent eaede1e commit b852f24

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

defaults/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ security_policy_enforcement_mode: transparent
4141
log_policy_filter_request_type: all
4242

4343
log_policy_syslog_target: 127.0.0.1:514
44-
nginx_demo_workload: http://10.1.1.1:8080
44+
45+
nginx_demo_workload_protocol: http://
46+
nginx_demo_workload_host: 10.1.1.1:8080

templates/nginx.conf.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ http {
1515
sendfile on;
1616
keepalive_timeout 65;
1717

18+
upstream backend_hosts {
19+
server {{ nginx_demo_workload_host }};
20+
}
21+
1822
server {
1923
listen 80;
2024
server_name localhost;
@@ -28,7 +32,7 @@ http {
2832
location / {
2933
client_max_body_size 0;
3034
default_type text/html;
31-
proxy_pass {{ nginx_demo_workload }}$request_uri;
35+
proxy_pass {{ nginx_demo_workload_protocol }}backend_hosts$request_uri;
3236
}
3337
}
3438
}

0 commit comments

Comments
 (0)