From 6b2638c2718563fd106dd5f41e5d867c1a63d498 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 23 Dec 2020 15:20:30 +0100 Subject: [PATCH] Documentation is located on /doc Signed-off-by: Yohann D'ANELLO --- .../host_vars/bde-nk20-beta.adh.crans.org.yml | 1 - ansible/host_vars/bde-note.adh.crans.org.yml | 2 -- ansible/host_vars/bde3-virt.adh.crans.org.yml | 2 -- .../roles/5-nginx/templates/nginx_note.conf | 32 +++---------------- nginx_note.conf_example | 3 ++ 5 files changed, 7 insertions(+), 33 deletions(-) diff --git a/ansible/host_vars/bde-nk20-beta.adh.crans.org.yml b/ansible/host_vars/bde-nk20-beta.adh.crans.org.yml index 725ca9ce..d4ef70ef 100644 --- a/ansible/host_vars/bde-nk20-beta.adh.crans.org.yml +++ b/ansible/host_vars/bde-nk20-beta.adh.crans.org.yml @@ -3,4 +3,3 @@ note: server_name: note-beta.crans.org git_branch: beta cron_enabled: false - doc_enabled: false diff --git a/ansible/host_vars/bde-note.adh.crans.org.yml b/ansible/host_vars/bde-note.adh.crans.org.yml index 287ff72a..ba085433 100644 --- a/ansible/host_vars/bde-note.adh.crans.org.yml +++ b/ansible/host_vars/bde-note.adh.crans.org.yml @@ -3,5 +3,3 @@ note: server_name: note.crans.org git_branch: master cron_enabled: true - doc_enabled: true - doc_url: doc.note.crans.org diff --git a/ansible/host_vars/bde3-virt.adh.crans.org.yml b/ansible/host_vars/bde3-virt.adh.crans.org.yml index 5eed89a9..477a4b7a 100644 --- a/ansible/host_vars/bde3-virt.adh.crans.org.yml +++ b/ansible/host_vars/bde3-virt.adh.crans.org.yml @@ -3,5 +3,3 @@ note: server_name: note-dev.crans.org git_branch: beta cron_enabled: false - doc_enabled: true - doc_url: bde3.crans.org diff --git a/ansible/roles/5-nginx/templates/nginx_note.conf b/ansible/roles/5-nginx/templates/nginx_note.conf index d2e65ba6..567c4789 100644 --- a/ansible/roles/5-nginx/templates/nginx_note.conf +++ b/ansible/roles/5-nginx/templates/nginx_note.conf @@ -3,34 +3,6 @@ upstream note { server unix:///var/www/note_kfet/note_kfet.sock; # file socket } -{% if note.doc_enabled %} -# Redirect doc HTTP to doc HTTPS -server { - listen 80; - listen [::]:80; - server_name {{ note.doc_url }}; - - location / { - return 301 https://{{ note.doc_url }}$request_uri; - } -} - -# configuration of the documentation website -server { - listen 443 ssl; - listen [::]:443 ssl; - - server_name {{ note.doc_url }}; - root /var/www/documentation; - charset utf-8; - - ssl_certificate /etc/letsencrypt/live/{{ note.server_name }}/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/{{ note.server_name }}/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; -} -{% endif %} - # Redirect HTTP to nk20 HTTPS server { listen 80 default_server; @@ -78,6 +50,10 @@ server { alias /var/www/note_kfet/static; # your Django project's static files - amend as required } + location /doc { + alias /var/www/documentation; # The documentation of the project + } + # Finally, send all non-media requests to the Django server. location / { uwsgi_pass note; diff --git a/nginx_note.conf_example b/nginx_note.conf_example index 48958a3e..7f4029d4 100644 --- a/nginx_note.conf_example +++ b/nginx_note.conf_example @@ -16,6 +16,9 @@ server { location /media { alias /var/www/note_kfet/media; } + location /doc { + alias /var/www/documentation; + } # Send all non-media requests to the Django server. location / {