jean-cloud-services/services/soundbase.radiodev.oma-radio.fr/nginx_server.conf
2025-10-31 18:49:12 +01:00

76 lines
1.9 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;
auth_basic "Entrez votre identifiant et mot de passe";
auth_basic_user_file $DATA_DIR/soundbase/users.htpasswd;
location /soundbase/fic {
alias $DATA_DIR/soundbase/fic;
index index.html;
# kill cache
add_header Cache-Control 'must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
location /soundbase {
alias $DATA_DIR/soundbase;
index index.html;
add_header Cache-Control 'must-revalidate, proxy-revalidate, max-age=0';
}
location /buildwebsite/ {
fastcgi_param SCRIPT_FILENAME $DOCKER_DIR/server.sh;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
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;
}
# Admin interface
location /manager {
alias $DATA_DIR/soundbase/manager;
try_files $uri $uri/ =404;
}
}