49 lines
1.2 KiB
Nginx Configuration File
49 lines
1.2 KiB
Nginx Configuration File
worker_processes auto;
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /var/www/html;
|
|
index index.php index.html;
|
|
|
|
# Main location block
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
# PHP-FPM: forward all .php requests to PHP-FPM on port 9000
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
fastcgi_read_timeout 300;
|
|
}
|
|
|
|
# Cache static files
|
|
location ~* \.(html|css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1d;
|
|
access_log off;
|
|
}
|
|
|
|
# Security: deny access to hidden files
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
}
|
|
}
|