2020-07-26 10:05:41 +00:00
|
|
|
# the upstream component nginx needs to connect to
|
|
|
|
upstream note{
|
|
|
|
server unix:///var/www/note_kfet/note_kfet.sock; # file socket
|
|
|
|
}
|
|
|
|
|
2020-07-29 21:00:57 +00:00
|
|
|
# Redirect HTTP to nk20 HTTPS
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
return 301 https://nk20-beta.crans.org$request_uri;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Redirect all HTTPS to nk20 HTTPS
|
|
|
|
server {
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
listen [::]:443 ssl default_server;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
return 301 https://nk20-beta.crans.org$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/nk20-beta.crans.org/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/nk20-beta.crans.org/privkey.pem;
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
}
|
|
|
|
|
2020-07-26 10:05:41 +00:00
|
|
|
# configuration of the server
|
|
|
|
server {
|
2020-07-29 21:00:57 +00:00
|
|
|
listen 443 ssl;
|
|
|
|
listen [::]:443 ssl;
|
|
|
|
|
2020-07-26 10:05:41 +00:00
|
|
|
# the port your site will be served on
|
|
|
|
# the domain name it will serve for
|
|
|
|
server_name nk20-beta.crans.org; # substitute your machine's IP address or FQDN
|
|
|
|
charset utf-8;
|
|
|
|
|
|
|
|
# max upload size
|
|
|
|
client_max_body_size 75M; # adjust to taste
|
|
|
|
|
|
|
|
# Django media
|
|
|
|
location /media {
|
|
|
|
alias /var/www/note_kfet/media; # your Django project's media files - amend as required
|
|
|
|
}
|
|
|
|
|
|
|
|
location /static {
|
|
|
|
alias /var/www/note_kfet/static; # your Django project's static files - amend as required
|
|
|
|
}
|
|
|
|
|
|
|
|
# Finally, send all non-media requests to the Django server.
|
|
|
|
location / {
|
|
|
|
uwsgi_pass note;
|
2020-09-01 12:19:24 +00:00
|
|
|
include /etc/nginx/uwsgi_params;
|
2020-07-26 10:05:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/nk20-beta.crans.org/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/nk20-beta.crans.org/privkey.pem;
|
|
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
}
|