48 lines
1.4 KiB
Nginx Configuration File
48 lines
1.4 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
charset utf-8;
|
|
|
|
# Correct MIME types — critical for Articulate Storyline .js bundles
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# Protect Modul 6 with password
|
|
location ~* ^/Trainings/WBT_ErkW_6_Administration_erw_Funktionen(_Internet)?/ {
|
|
auth_basic "Administration Area";
|
|
auth_basic_user_file /etc/nginx/.htpasswd;
|
|
try_files $uri $uri/ =404;
|
|
|
|
# Never cache dynamic course scripts and metadata
|
|
location ~* \.(html|json|js)$ {
|
|
add_header Cache-Control "no-cache, must-revalidate";
|
|
}
|
|
|
|
# Cache static media assets inside the protected directory
|
|
location ~* \.(css|png|jpg|jpeg|gif|svg|woff|woff2|ttf|mp3|mp4)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public, must-revalidate";
|
|
}
|
|
}
|
|
|
|
# Never cache dynamic course scripts and metadata
|
|
location ~* \.(html|json|js)$ {
|
|
add_header Cache-Control "no-cache, must-revalidate";
|
|
}
|
|
|
|
# Cache static media assets
|
|
location ~* \.(css|png|jpg|jpeg|gif|svg|woff|woff2|ttf|mp3|mp4)$ {
|
|
expires 7d;
|
|
add_header Cache-Control "public, must-revalidate";
|
|
}
|
|
}
|