40 lines
1.2 KiB
Text
40 lines
1.2 KiB
Text
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name localhost;
|
||
|
|
root /var/www/html/public;
|
||
|
|
index index.php;
|
||
|
|
|
||
|
|
# Disable access log for performance
|
||
|
|
access_log off;
|
||
|
|
error_log /var/log/nginx/error.log error;
|
||
|
|
|
||
|
|
# Gzip compression
|
||
|
|
gzip on;
|
||
|
|
gzip_vary on;
|
||
|
|
gzip_min_length 1024;
|
||
|
|
gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss application/rss+xml application/atom+xml image/svg+xml text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype;
|
||
|
|
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.php?$query_string;
|
||
|
|
}
|
||
|
|
|
||
|
|
location ~ \.php$ {
|
||
|
|
try_files $uri =404;
|
||
|
|
fastcgi_pass 127.0.0.1:9000;
|
||
|
|
fastcgi_index index.php;
|
||
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
|
|
include fastcgi_params;
|
||
|
|
fastcgi_buffer_size 32k;
|
||
|
|
fastcgi_buffers 8 16k;
|
||
|
|
fastcgi_read_timeout 240;
|
||
|
|
}
|
||
|
|
|
||
|
|
location ~ /\.(?!well-known).* {
|
||
|
|
deny all;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 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;
|
||
|
|
}
|