Add configs (resolve #2)

This commit is contained in:
2020-12-07 23:00:51 +01:00
committed by Oskar
parent 8a57b0cd84
commit 6760ed65a2
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,36 @@
server {
listen 443 ssl;
server_name quiz.fasttube.de;
root /root/fs-quiz-tool/web;
index index.html;
location / {
# First attempt to serve request as file
# If no such file, pass to backend
try_files $uri $uri/ =404;
}
location /db {
proxy_pass http://127.0.0.1:12345;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
ssl_certificate /usr/local/etc/letsencrypt/live/quiz.fasttube.de/fullchain.pem;
ssl_certificate_key /usr/local/etc/letsencrypt/live/quiz.fasttube.de/privkey.pem;
}
server {
server_name quiz.fasttube.de;
listen 80;
# 308 instead of 301 to prohibit method change on redirect
# (some clients change POST to GET on 301, 308 does not allow that)
return 308 https://$host$request_uri;
}