Add configs (resolve #2)
This commit is contained in:
parent
8a57b0cd84
commit
6760ed65a2
|
@ -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;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# PROVIDE: fs_quiz_tool
|
||||||
|
# REQUIRE: LOGIN DAEMON NETWORKING
|
||||||
|
# KEYWORD: fasttube fs quiz tool
|
||||||
|
|
||||||
|
# Enable this script by adding:
|
||||||
|
# fs_quiz_tool_enable="YES"
|
||||||
|
# ... to /etc/rc.conf
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name="fs_quiz_tool"
|
||||||
|
rcvar="fs_quiz_tool_enable"
|
||||||
|
|
||||||
|
pidfile="/var/run/${name}.pid"
|
||||||
|
|
||||||
|
task="/usr/local/bin/python3.7 -m fs-quiz-tool-db"
|
||||||
|
procname="/usr/local/bin/python3.7"
|
||||||
|
|
||||||
|
command="/usr/sbin/daemon"
|
||||||
|
command_args="-p ${pidfile} ${task}"
|
||||||
|
|
||||||
|
load_rc_config ${name}
|
||||||
|
run_rc_command "$1"
|
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=FaSTTUBe FS Quiz Tool
|
||||||
|
After=syslog.target network.target nginx.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
ExecStart=/usr/bin/python3 -m fs-quiz-tool-db
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue