From 214cd1d03c64f43f1eb53853f8f5ea5279367d89 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sun, 5 Jan 2020 19:27:39 +0100 Subject: [PATCH] Fix the nginx includes filenames of the new onlyoffice package --- library/roles/onlyoffice_docserver/tasks/main.yml | 4 ++-- .../templates/onlyoffice-documentserver-ssl.conf | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/library/roles/onlyoffice_docserver/tasks/main.yml b/library/roles/onlyoffice_docserver/tasks/main.yml index 9b09523e..a2227322 100644 --- a/library/roles/onlyoffice_docserver/tasks/main.yml +++ b/library/roles/onlyoffice_docserver/tasks/main.yml @@ -24,8 +24,8 @@ template: src=local.json dest=/etc/onlyoffice/documentserver/local.json owner=root group=root mode=0444 - name: Install the OnlyOffice document server configuration that enables SSL - template: src=onlyoffice-documentserver-ssl.conf dest=/etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf - when: onlyoffice_docserver_letsencrypt_managed + template: src=onlyoffice-documentserver-ssl.conf dest=/etc/onlyoffice/documentserver/nginx/ds.conf + when: onlyoffice_docserver_letsencrypt_managed | bool notify: Reload nginx tags: [ 'onlyoffice', 'letsencrypt', 'nginx' ] diff --git a/library/roles/onlyoffice_docserver/templates/onlyoffice-documentserver-ssl.conf b/library/roles/onlyoffice_docserver/templates/onlyoffice-documentserver-ssl.conf index 0ca187f9..153eb716 100644 --- a/library/roles/onlyoffice_docserver/templates/onlyoffice-documentserver-ssl.conf +++ b/library/roles/onlyoffice_docserver/templates/onlyoffice-documentserver-ssl.conf @@ -1,5 +1,4 @@ -include /etc/nginx/includes/onlyoffice-http.conf; - +include /etc/nginx/includes/http-common.conf; ## Normal HTTP host server { listen 0.0.0.0:80; @@ -10,7 +9,9 @@ server { include /etc/nginx/snippets/letsencrypt-proxy.conf; ## Redirects all traffic to the HTTPS host root /nowhere; ## root doesn't have to be a valid path since we are redirecting - rewrite ^ https://$host$request_uri? permanent; + location / { + return 301 https://$host$request_uri?; + } } #HTTP host for internal services @@ -21,8 +22,8 @@ server { server_tokens off; include /etc/nginx/snippets/letsencrypt-proxy.conf; - include /etc/nginx/includes/onlyoffice-documentserver-common.conf; - include /etc/nginx/includes/onlyoffice-documentserver-docservice.conf; + include /etc/nginx/includes/ds-*.conf; + } ## HTTPS host @@ -38,6 +39,6 @@ server { include /etc/nginx/snippets/nginx-server-ssl.conf; # add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; - include /etc/nginx/includes/onlyoffice-documentserver-*.conf; + include /etc/nginx/includes/ds-*.conf; }