Sfoglia il codice sorgente

:bug: fix zone load balancers

Jeremy Zheng 4 anni fa
parent
commit
61a73b7967

+ 1 - 1
deploy/roles/mint-www/templates/nginx.conf.j2

@@ -8,7 +8,7 @@ server {
     add_header X-Content-Type-Options "nosniff";
 
     gzip on;
-    server_name {{ inventory_hostname }};
+    server_name {{ inventory_hostname }} {% for it in groups['zone'] %} {{ it }} {% endfor %};
     root {{ app_deploy_target }}/public;
     client_max_body_size 16M;
     index index.php;

+ 0 - 7
deploy/roles/mint-zone/tasks/main.yml

@@ -1,10 +1,3 @@
-- name: Creates deploy directory
-  become: true
-  file:
-    path: "{{ app_deploy_target }}"
-    state: directory
-    owner: "{{ ansible_user }}"
-
 - name: upload nginx.conf
   become: true
   ansible.builtin.template:

+ 1 - 2
deploy/roles/mint-zone/templates/nginx.conf.j2

@@ -11,15 +11,14 @@ server {
 
     gzip on;
     server_name {{ inventory_hostname }};
-    root {{ app_deploy_target }};
     client_max_body_size 16M;
-    index index.html;
     charset utf-8;
 
     access_log off;
     error_log /var/log/nginx/{{ inventory_hostname }}.error.log warn;
 
     location / {
+        proxy_set_header Host $host;
         proxy_pass http://{{ app_cluster_domain }};
     }
 }

+ 1 - 0
deploy/roles/ubuntu/tasks/main.yml

@@ -92,6 +92,7 @@
       - zip
       - unzip
       - nginx
+      - libnginx-mod-http-upstream-fair
       - certbot
       - python3-certbot-nginx
       - openvpn