feat: implement project management system with Nginx configuration templates and automated host file updates
This commit is contained in:
@@ -1,31 +1,24 @@
|
||||
location ^~ /{{HOST}}/ {
|
||||
alias "{{PATH}}";
|
||||
server {
|
||||
listen {{PORT}};
|
||||
server_name {{HOST}};
|
||||
root "{{PATH}}";
|
||||
index index.php index.html;
|
||||
autoindex on;
|
||||
|
||||
# Use a named location for reliable alias fallback
|
||||
try_files $uri $uri/ @{{HOST}};
|
||||
|
||||
# PHP handling nested INSIDE the alias location to maintain context
|
||||
# Support for clean URLs
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
# PHP handling
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass 127.0.0.1:{{PHP_PORT}};
|
||||
fastcgi_index index.php;
|
||||
|
||||
include "{{CONF_DIR}}/fastcgi_params";
|
||||
|
||||
# Normal files matched correctly by URI don't suffer the try_files bug
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
|
||||
# The named location handles requests that don't match physical files
|
||||
location @{{HOST}} {
|
||||
# Directly execute PHP without URI mutation to preserve framework routing paths
|
||||
fastcgi_pass 127.0.0.1:{{PHP_PORT}};
|
||||
include "{{CONF_DIR}}/fastcgi_params";
|
||||
|
||||
# Hardcode the essential execution parameters
|
||||
fastcgi_param SCRIPT_FILENAME "{{PATH}}index.php";
|
||||
fastcgi_param SCRIPT_NAME "/{{HOST}}/index.php";
|
||||
fastcgi_param DOCUMENT_ROOT "{{PATH}}";
|
||||
# Custom log files for the project
|
||||
# access_log "{{LOG_DIR}}/{{HOST}}_access.log";
|
||||
# error_log "{{LOG_DIR}}/{{HOST}}_error.log";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user