Skip to content

Commit 4201b7c

Browse files
committed
Fix Nginx role
1 parent d4b2bc6 commit 4201b7c

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

pkg/registry/roles/nginx/tasks/main.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
mode: 0600
4141

4242
#
43-
# Run official Nginx Docker container with specified version.
43+
# Run official Nginx Docker container (for HTTP only) with specified version.
4444
#
45-
- name: Run Nginx container
45+
- name: Run Nginx container (for HTTP)
4646
community.docker.docker_container:
4747
name: cgapp-nginx
4848
image: "nginx:{{ nginx_version }}"
@@ -51,7 +51,27 @@
5151
networks:
5252
- name: "{{ docker_network }}"
5353
ports:
54-
- ["80:80", "{{ '443:443' if nginx_use_only_https == 'yes' }}"]
54+
- "80:80"
5555
volumes:
5656
- "{{ server_dir }}/webserver/nginx.conf:/etc/nginx/nginx.conf:ro"
5757
- "{{ server_dir }}/webserver/default.conf:/etc/nginx/conf.d/default.conf:ro"
58+
when: nginx_use_only_https == 'no'
59+
60+
#
61+
# Run official Nginx Docker container (for HTTPS only) with specified version.
62+
#
63+
- name: Run Nginx container (for HTTPS only)
64+
community.docker.docker_container:
65+
name: cgapp-nginx
66+
image: "nginx:{{ nginx_version }}"
67+
restart_policy: unless-stopped
68+
recreate: true
69+
networks:
70+
- name: "{{ docker_network }}"
71+
ports:
72+
- "80:80"
73+
- "443:443"
74+
volumes:
75+
- "{{ server_dir }}/webserver/nginx.conf:/etc/nginx/nginx.conf:ro"
76+
- "{{ server_dir }}/webserver/default.conf:/etc/nginx/conf.d/default.conf:ro"
77+
when: nginx_use_only_https == 'yes'

pkg/registry/templates/playbook.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
roles:
1616
- { role: docker, tags: [docker] }
17+
- { role: backend, tags: [backend] }
1718
- { role: redis, tags: [redis] }
1819
- { role: postgres, tags: [postgres] }
19-
- { role: backend, tags: [backend] }
2020
{{ if ne .Proxy "none" }} - { role: {{.Proxy}}, tags: [{{.Proxy}}] }{{ end }}

0 commit comments

Comments
 (0)