56 lines
1.6 KiB
Plaintext
56 lines
1.6 KiB
Plaintext
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name pkrstarsbot.zinomedia.de;
|
|
|
|
access_log off;
|
|
error_log /var/log/nginx/error.log error;
|
|
|
|
root /usr/share/nginx/html/pkrstarsbot.zinomedia.de/www/htdocs;
|
|
index index.php index.html;
|
|
|
|
# SSL Certificate Configuration
|
|
ssl_certificate /etc/letsencrypt/live/pkrstarsbot.zinomedia.de/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/pkrstarsbot.zinomedia.de/privkey.pem;
|
|
|
|
# SSL Optimizations
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data:; style-src 'self'; font-src 'self' data:;" always;
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# Password protect
|
|
#auth_basic "Protected Area";
|
|
#auth_basic_user_file /usr/share/nginx/html/pkrstarsbot.zinomedia.de/www/htdocs/.htpasswd;
|
|
|
|
# PHP Processing
|
|
location ~ \.php$ {
|
|
resolver 127.0.0.11;
|
|
set $upstream "php-fpm:9000";
|
|
|
|
include fastcgi_params;
|
|
fastcgi_pass $upstream;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_index index.php;
|
|
}
|
|
|
|
# Static File Caching (Optional)
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name pkrstarsbot.zinomedia.de;
|
|
return 301 https://$host$request_uri;
|
|
}
|