diff --git a/tasks/packages.yml b/tasks/packages.yml index 95844b4..f29752c 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -33,18 +33,6 @@ - patch - pkg-config - rbenv + - redis - sudo - - yarnpkg - zlib1g-dev - -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=940511 -- name: "packages | ensure cmdtest is not installed" - apt: - name: cmdtest - state: absent - -- name: "packages | Erstelle yarn-Symlink" - file: - src: /usr/bin/yarnpkg - dest: /usr/local/bin/yarn - state: link diff --git a/tasks/webserver.yml b/tasks/webserver.yml index 9dce030..5e35c87 100644 --- a/tasks/webserver.yml +++ b/tasks/webserver.yml @@ -2,11 +2,14 @@ template: src: nginx-site.j2 dest: "{{ zammad_webserver_configuration }}" + notify: reload nginx - name: "webserver: Kofiguration aktivieren" file: src: "{{ zammad_webserver_configuration }}" dest: "/etc/nginx/sites-enabled/{{ zammad_domain }}" state: link + notify: reload nginx + diff --git a/templates/nginx-rp-site.j2 b/templates/nginx-rp-site.j2 index 5983dbb..aa4e0be 100644 --- a/templates/nginx-rp-site.j2 +++ b/templates/nginx-rp-site.j2 @@ -11,6 +11,11 @@ server { ssl_certificate /var/lib/dehydrated/certs/{{ zammad_domain }}/fullchain.pem; ssl_certificate_key /var/lib/dehydrated/certs/{{ zammad_domain }}/privkey.pem; include /etc/nginx/snippets/add_headers.conf; + location /cable { + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://{{ inventory_hostname }}:80; + } location /ws { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; diff --git a/templates/nginx-site.j2 b/templates/nginx-site.j2 index 7a4b59c..77b9b28 100644 --- a/templates/nginx-site.j2 +++ b/templates/nginx-site.j2 @@ -1,3 +1,13 @@ +### {{ ansible_managed }} + +upstream zammad-railsserver { + server 127.0.0.1:3000; +} + +upstream zammad-websocket { + server 127.0.0.1:6042; +} + server { listen 80; server_name {{ zammad_domain }}; @@ -11,6 +21,17 @@ server { expires max; } + location /cable { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header CLIENT_IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 86400; + proxy_pass http://zammad-railsserver; + } + location /ws { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -18,7 +39,7 @@ server { proxy_set_header CLIENT_IP $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 86400; - proxy_pass http://127.0.0.1:6042; + proxy_pass http://zammad-websocket; } location / { @@ -28,6 +49,6 @@ server { # Change this line in an SSO setup proxy_set_header X-Forwarded-User ""; proxy_read_timeout 300; - proxy_pass http://127.0.0.1:3000; + proxy_pass http://zammad-railsserver; } }