nis2-agile/docker/nginx.conf
Cristiano Benassati ae78a2f7f4 [CORE] Initial project scaffold - NIS2 Agile Compliance Platform
Complete MVP implementation including:
- PHP 8.4 backend with Front Controller pattern (80+ API endpoints)
- Multi-tenant architecture with organization_id isolation
- JWT authentication (HS256, 2h access + 7d refresh tokens)
- 14 controllers: Auth, Organization, Assessment, Dashboard, Risk,
  Incident, Policy, SupplyChain, Training, Asset, Audit, Admin
- AI Service integration (Anthropic Claude API) for gap analysis,
  risk suggestions, policy generation, incident classification
- NIS2 gap analysis questionnaire (~80 questions, 10 categories)
- MySQL schema (20 tables) with NIS2 Art. 21 compliance controls
- NIS2 Art. 23 incident reporting workflow (24h/72h/30d)
- Frontend: login, register, dashboard, assessment wizard, org setup
- Docker configuration (PHP-FPM + Nginx + MySQL)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:50:18 +01:00

63 lines
2.8 KiB
Nginx Configuration File

server {
listen 8080;
server_name _;
root /var/www/nis2-agile/public;
index index.php index.html;
charset utf-8;
# ── 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;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# ── Logging ────────────────────────────────────────────────────────────
access_log /var/log/nginx/nis2-access.log;
error_log /var/log/nginx/nis2-error.log;
# ── Max Upload Size ────────────────────────────────────────────────────
client_max_body_size 20M;
# ── Main Location ──────────────────────────────────────────────────────
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# ── PHP-FPM Processing ─────────────────────────────────────────────────
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param HTTP_PROXY "";
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_read_timeout 300;
}
# ── Static Assets Caching ──────────────────────────────────────────────
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, immutable";
access_log off;
}
# ── Deny Hidden Files ──────────────────────────────────────────────────
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# ── Deny access to sensitive files ─────────────────────────────────────
location ~* \.(env|sql|md|json|lock|yml|yaml)$ {
deny all;
access_log off;
log_not_found off;
}
}