mirror of
https://github.com/manualdousuario/marreta.git
synced 2025-04-25 16:09:10 +00:00
66 lines
2 KiB
Text
66 lines
2 KiB
Text
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
root /app;
|
|
index index.php index.html index.htm;
|
|
|
|
server_name _;
|
|
|
|
# Hide NGINX version to reduce exposed information
|
|
# Oculta a versão do NGINX para reduzir informações expostas
|
|
server_tokens off;
|
|
|
|
# NGINX-specific security configurations
|
|
# Configurações de segurança específicas do NGINX
|
|
|
|
# Limit upload size to prevent denial of service attacks
|
|
# Limita o tamanho de uploads para prevenir ataques de negação de serviço
|
|
client_max_body_size 10M;
|
|
client_body_buffer_size 128k;
|
|
|
|
# Disable directory listing to prevent structure exposure
|
|
# Desativa listagem de diretórios para evitar exposição de estrutura
|
|
autoindex off;
|
|
|
|
# Block access to sensitive directories
|
|
# Bloqueia acesso a diretórios sensíveis
|
|
location ~ ^/(logs|cache|inc|data|cli|bin|languages|vendor)/ {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
# All requests go through index.php for FastRoute routing
|
|
# Todas as requisições passam pelo index.php para roteamento FastRoute
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$args;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include snippets/fastcgi-php.conf;
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
|
|
# Hide header that reveals PHP version
|
|
# Oculta cabeçalho que revela a versão do PHP
|
|
fastcgi_hide_header X-Powered-By;
|
|
}
|
|
|
|
# Block access to hidden files and directories
|
|
# Bloqueia acesso a arquivos e diretórios ocultos
|
|
location ~ /\. {
|
|
deny all;
|
|
return 404;
|
|
}
|
|
|
|
# Block access to configuration and database files
|
|
# Bloqueia acesso a arquivos de configuração e banco de dados
|
|
location ~ \.(sql|conf|ini)$ {
|
|
deny all;
|
|
return 404;
|
|
}
|
|
|
|
# Minimize logs to reduce information exposure
|
|
# Minimiza logs para reduzir exposição de informações
|
|
access_log /dev/null;
|
|
error_log /dev/stderr warn;
|
|
}
|