feat: add nginx configuration template with dynamic project routing and php-fpm support

This commit is contained in:
Ümit Tunç
2026-03-31 00:44:59 +03:00
parent b2a0a5483f
commit da1640c334
+17 -1
View File
@@ -17,7 +17,23 @@ http {
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
# Try global root first, fallback to @project_fallback if not found
error_page 404 = @project_fallback;
try_files $uri $uri/ =404;
}
# Handle root-relative asset requests from project folders
location @project_fallback {
# Skip for common non-project paths
if ($uri ~* ^/(favicon\.ico|phpmyadmin|admin)) {
return 404;
}
# Capture project slug from Referer header (e.g., http://localhost/my-project/...)
if ($http_referer ~* "^https?://[^/]+/([^/]+)/") {
set $proj_slug $1;
rewrite ^(.*)$ /$proj_slug$1 last;
}
return 404;
}
{{PROJECTS}}