2021-12-07 13:26:24 +00:00
|
|
|
upstream reftest {
|
2022-06-17 02:00:37 +01:00
|
|
|
server app:5000;
|
2021-12-07 13:26:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-06-17 01:09:15 +01:00
|
|
|
server_name domain_name;
|
2022-06-16 13:21:27 +01:00
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
2021-12-07 13:26:24 +00:00
|
|
|
# Redirect to ssl
|
2022-04-17 18:42:40 +01:00
|
|
|
return 301 https://$host$request_uri;
|
2021-12-07 13:26:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-06-17 01:09:15 +01:00
|
|
|
server_name domain_name;
|
2022-06-16 13:21:27 +01:00
|
|
|
listen 443 ssl http2 default_server;
|
|
|
|
listen [::]:443 ssl http2 default_server;
|
2021-12-07 13:26:24 +00:00
|
|
|
|
2022-08-18 17:00:51 +01:00
|
|
|
# SSL configuration
|
2022-04-17 18:42:40 +01:00
|
|
|
include /etc/nginx/ssl.conf;
|
|
|
|
include /etc/nginx/certbot-challenge.conf;
|
2021-12-07 13:26:24 +00:00
|
|
|
|
2022-08-17 16:32:58 +01:00
|
|
|
# Define locations for static files to be served by Nginx
|
2022-08-18 17:08:03 +01:00
|
|
|
location ^~ /root/ {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
alias /usr/share/nginx/html/root/;
|
|
|
|
}
|
|
|
|
|
2022-06-16 12:52:55 +01:00
|
|
|
location ^~ /quiz/static/ {
|
2021-12-07 13:26:24 +00:00
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
alias /usr/share/nginx/html/quiz/static/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ^~ /admin/static/ {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
alias /usr/share/nginx/html/admin/static/;
|
|
|
|
}
|
|
|
|
|
2022-06-22 11:18:53 +01:00
|
|
|
location ^~ /admin/editor/static/ {
|
|
|
|
include /etc/nginx/mime.types;
|
2022-08-18 17:17:56 +01:00
|
|
|
alias /usr/share/nginx/html/editor/static/;
|
2022-06-22 11:18:53 +01:00
|
|
|
}
|
|
|
|
|
2022-08-17 16:32:58 +01:00
|
|
|
location ^~ /admin/view/static/ {
|
|
|
|
include /etc/nginx/mime.types;
|
2022-08-18 17:17:56 +01:00
|
|
|
alias /usr/share/nginx/html/view/static/;
|
2022-08-17 16:32:58 +01:00
|
|
|
}
|
|
|
|
|
2023-03-07 11:38:04 +00:00
|
|
|
location ^~ /admin/analysis/static/ {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
alias /usr/share/nginx/html/analysis/static/;
|
|
|
|
}
|
|
|
|
|
2022-08-17 16:32:58 +01:00
|
|
|
# Proxy to the main app for all other requests
|
2021-12-07 13:26:24 +00:00
|
|
|
location / {
|
2022-06-17 12:58:46 +01:00
|
|
|
include /etc/nginx/conf.d/proxy_headers.conf;
|
2021-12-07 13:26:24 +00:00
|
|
|
proxy_pass http://reftest;
|
|
|
|
}
|
2022-06-17 02:00:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
server_name www.domain_name;
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
# Redirect to non-www
|
2022-06-17 12:58:46 +01:00
|
|
|
return 301 $scheme://domain_name$request_uri;
|
2022-06-17 02:00:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
server_name www.domain_name;
|
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
|
|
|
|
# SSL configuration
|
|
|
|
include /etc/nginx/ssl.conf;
|
|
|
|
include /etc/nginx/certbot-challenge.conf;
|
|
|
|
|
|
|
|
# Redirect to non-www
|
2022-06-17 12:58:46 +01:00
|
|
|
return 301 $scheme://domain_name$request_uri;
|
2021-12-07 13:26:24 +00:00
|
|
|
}
|