server { listen 80; server_name ${DOMAIN} *.${DOMAIN}; root /var/www/html; index index.php; # Von Traefik weitergereichte IP real_ip_header X-Forwarded-For; set_real_ip_from 0.0.0.0/0; # Logs (optional) access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # Statische Dateien direkt ausliefern location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; } location ~* \.(css|gif|ico|jpeg|jpg|js|png|svg|webp|woff2?)$ { expires max; log_not_found off; } # Kein direkter PHP‑Zugriff in Uploads location ~* ^/wp-content/uploads/.*\.php$ { deny all; } # Haupt‑Rewrite für WordPress / Multisite location / { try_files $uri $uri/ /index.php?$args; } # PHP an FPM durchreichen location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; fastcgi_pass php:9000; fastcgi_index index.php; } }