61 lines
1.5 KiB
Plaintext
61 lines
1.5 KiB
Plaintext
# Parameters:
|
|
# radio name
|
|
# file path
|
|
# ws port (local)
|
|
# wss port (open)
|
|
# upload service port
|
|
# ssl certs location
|
|
|
|
# TODO
|
|
# /speedtest-down returns random data
|
|
# can use : openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero > randomfile.bin
|
|
# /speedtest-up just eat everything it can
|
|
|
|
|
|
|
|
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name $JC_SERVICE;
|
|
|
|
ssl_certificate $JC_CERT/fullchain.pem;
|
|
ssl_certificate_key $JC_CERT/privkey.pem;
|
|
|
|
root $SOUNDBASE_DIR;
|
|
index index.html;
|
|
auth_basic "Entrez votre identifiant et mot de passe";
|
|
auth_basic_user_file $SOUNDBASE_DIR/users.htpasswd;
|
|
|
|
location /soundbase {
|
|
alias "$DATA_DIR/soundbase";
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location / {
|
|
root "$DATA_DIR/soundbase/website";
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location ~ /api(/.*) {
|
|
include uwsgi_params;
|
|
uwsgi_param PATH_INFO "$1";
|
|
uwsgi_param SCRIPT_NAME /api;
|
|
uwsgi_pass unix:/tmp/uwsgi/$JC_SERVICE/uwsgi-api.sock;
|
|
client_max_body_size 0;
|
|
proxy_connect_timeout 6000;
|
|
proxy_send_timeout 60000;
|
|
proxy_read_timeout 6000;
|
|
send_timeout 6000;
|
|
# kill cache
|
|
add_header Last-Modified $date_gmt;
|
|
add_header Cache-Control 'private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
if_modified_since off;
|
|
expires off;
|
|
etag off;
|
|
}
|
|
|
|
|
|
}
|