ska-referee-test/nginx/conf.d/ref-test-app.conf

57 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

upstream reftest {
server app:5000;
}
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;
# Redirect to ssl
2022-04-17 18:42:40 +01:00
return 301 https://$host$request_uri;
}
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;
# SSL configuration
2022-04-17 18:42:40 +01:00
include /etc/nginx/ssl.conf;
include /etc/nginx/certbot-challenge.conf;
2022-06-16 12:52:55 +01:00
location ^~ /quiz/static/ {
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/;
}
location / {
2022-06-17 12:58:46 +01:00
include /etc/nginx/conf.d/proxy_headers.conf;
proxy_pass http://reftest;
}
}
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;
}
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;
}