Documentation is located on /doc

Signed-off-by: Yohann D'ANELLO <yohann.danello@gmail.com>
This commit is contained in:
Yohann D'ANELLO 2020-12-23 15:20:30 +01:00
parent 72dca54bbf
commit 6b2638c271
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
5 changed files with 7 additions and 33 deletions

View File

@ -3,4 +3,3 @@ note:
server_name: note-beta.crans.org server_name: note-beta.crans.org
git_branch: beta git_branch: beta
cron_enabled: false cron_enabled: false
doc_enabled: false

View File

@ -3,5 +3,3 @@ note:
server_name: note.crans.org server_name: note.crans.org
git_branch: master git_branch: master
cron_enabled: true cron_enabled: true
doc_enabled: true
doc_url: doc.note.crans.org

View File

@ -3,5 +3,3 @@ note:
server_name: note-dev.crans.org server_name: note-dev.crans.org
git_branch: beta git_branch: beta
cron_enabled: false cron_enabled: false
doc_enabled: true
doc_url: bde3.crans.org

View File

@ -3,34 +3,6 @@ upstream note {
server unix:///var/www/note_kfet/note_kfet.sock; # file socket 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 # Redirect HTTP to nk20 HTTPS
server { server {
listen 80 default_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 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. # Finally, send all non-media requests to the Django server.
location / { location / {
uwsgi_pass note; uwsgi_pass note;

View File

@ -16,6 +16,9 @@ server {
location /media { location /media {
alias /var/www/note_kfet/media; alias /var/www/note_kfet/media;
} }
location /doc {
alias /var/www/documentation;
}
# Send all non-media requests to the Django server. # Send all non-media requests to the Django server.
location / { location / {