server { listen 80; server_name localhost; root /var/www/html; index index.php index.html; charset utf-8; # 그누보드 rewrite 규칙 location / { try_files $uri $uri/ /index.php?$query_string; } # PHP 처리 location ~ \.php$ { fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 300; } # 정적 파일 캐싱 location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff|woff2)$ { expires 30d; add_header Cache-Control "public, immutable"; } # 보안: 숨김 파일 차단 location ~ /\. { deny all; } # 보안: data 폴더 PHP 실행 차단 location ~* ^/data/.*\.php$ { deny all; } # 업로드 크기 제한 client_max_body_size 50M; }