diff options
author | Samuli Silvius <s.silvius@partner.samsung.com> | 2019-02-13 11:00:39 +0200 |
---|---|---|
committer | Samuli Silvius <s.silvius@partner.samsung.com> | 2019-03-04 19:09:57 +0200 |
commit | f6f5fc4fdba4cb36f600d9f13c65ca27ec003b89 (patch) | |
tree | 554350f081f30dc5fe32abe4ab4ae34f7c7a669c /ansible/roles/nginx | |
parent | 3313c854585836ec97b72e2ff82d9ed4bf4ed710 (diff) |
Re-factor nexus role to streamline playbook
Move nexus functionality into nexus role from
infrastructure playbook.
This will make role easier to test and make
it easier to implement other OS support later.
Issue-ID: OOM-1653
Change-Id: I1af2bfef5aa4d6c7b819f5fc40f95c6e8303598c
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
Diffstat (limited to 'ansible/roles/nginx')
-rw-r--r-- | ansible/roles/nginx/templates/nginx.conf.j2 | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ansible/roles/nginx/templates/nginx.conf.j2 b/ansible/roles/nginx/templates/nginx.conf.j2 index fb48565f..ff9d2a9c 100644 --- a/ansible/roles/nginx/templates/nginx.conf.j2 +++ b/ansible/roles/nginx/templates/nginx.conf.j2 @@ -12,14 +12,6 @@ http { proxy_send_timeout 120; proxy_read_timeout 300; - upstream nexus { - server nexus:8081; - } - - upstream registry { - server nexus:8082; - } - # http simulations server { listen 80; @@ -38,6 +30,7 @@ http { # nexus simulations server { + resolver 127.0.0.11 valid=30s; listen 80; listen 443 ssl; server_name {% for host in simulated_hosts.nexus -%} @@ -53,11 +46,13 @@ http { client_max_body_size 3G; location / { + set $upstream_nexus nexus:8081; + set $upstream_registry nexus:8082; # redirect to docker registry if ($http_user_agent ~ docker ) { - proxy_pass http://registry; + proxy_pass http://$upstream_registry; } - proxy_pass http://nexus; + proxy_pass http://$upstream_nexus; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |