Files

72 lines
2.2 KiB
Plaintext

# =============================================================================
# NGINX CONFIGURATION FOR RKM SISTEM (PORT 80 - CLOUDFLARE TUNNEL READY)
# =============================================================================
server {
listen 80;
server_name localhost rkm.kmhindonesia.com _;
root /var/www/public;
index index.php index.html;
client_max_body_size 500M;
client_body_buffer_size 1M;
client_body_timeout 3600s;
client_header_timeout 3600s;
send_timeout 3600s;
keepalive_timeout 3600s;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
charset utf-8;
# Gzip Compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Static Assets Caching
location ^~ /storage/ {
alias /var/www/storage/app/public/;
expires 30d;
access_log off;
add_header Cache-Control "public, no-transform";
}
location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv|svgz?|ttf|ttc|otf|eot|woff2?)$ {
expires 1y;
access_log off;
add_header Cache-Control "public, no-transform, immutable";
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
fastcgi_hide_header X-Powered-By;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
}
location ~ /\.(?!well-known).* {
deny all;
}
}