the middle of the idiots
This commit is contained in:
41
qwen/php/docker/nginx/default.conf
Normal file
41
qwen/php/docker/nginx/default.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
# docker/nginx/default.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /var/www/html/public;
|
||||
index index.php index.html;
|
||||
|
||||
# Serve static files directly
|
||||
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# Main location block for PHP files
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
# PHP-FPM configuration
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
# Security: deny access to hidden files
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Security: deny access to composer files
|
||||
location ~ /composer\.(json|lock) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Security: deny access to sensitive files
|
||||
location ~ \.(env|htaccess|git) {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user