@@ -22,7 +22,10 @@ server {
2222 # SSL Settings
2323 include /etc/nginx/ssl/sslshared.conf;
2424
25- root /var/www/admin/enginescript;
25+ # Root directory for EngineScript Control Panel
26+ # Tools (phpMyAdmin, TinyFileManager, etc.) are in /var/www/admin/tools/
27+ # and accessed via location blocks below
28+ root /var/www/admin/control-panel;
2629
2730 # Admin Control Panel Protection
2831 # Adds a basic authentication prompt to the admin control panel.
@@ -38,7 +41,7 @@ server {
3841 fastcgi_cache off;
3942 set $skip_cache 1;
4043
41- # EngineScript Control Panel - Default Location
44+ # EngineScript Control Panel - Default Location (Landing Page)
4245 location / {
4346 try_files $uri $uri/ /index.html =404;
4447 }
@@ -53,6 +56,85 @@ server {
5356 rewrite ^/services/(.*)$ /api.php?endpoint=services/$1 last;
5457 }
5558
59+ # ============================================================
60+ # Admin Tools - Separate directory from control panel
61+ # Tools are stored in /var/www/admin/tools/ to prevent
62+ # EngineScript updates from overwriting tool configurations
63+ # ============================================================
64+
65+ # phpMyAdmin - Database management tool
66+ location /phpmyadmin {
67+ alias /var/www/admin/tools/phpmyadmin;
68+ index index.php;
69+
70+ location ~ \.php$ {
71+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
72+ fastcgi_param SCRIPT_FILENAME $request_filename;
73+ include /etc/nginx/globals/php-fpm.conf;
74+ }
75+ }
76+
77+ # TinyFileManager - File management tool
78+ location /tinyfilemanager {
79+ alias /var/www/admin/tools/tinyfilemanager;
80+ index tinyfilemanager.php;
81+
82+ location ~ \.php$ {
83+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
84+ fastcgi_param SCRIPT_FILENAME $request_filename;
85+ include /etc/nginx/globals/php-fpm.conf;
86+ }
87+ }
88+
89+ # phpSysInfo - System information tool
90+ location /phpsysinfo {
91+ alias /var/www/admin/tools/phpsysinfo;
92+ index index.php;
93+
94+ location ~ \.php$ {
95+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
96+ fastcgi_param SCRIPT_FILENAME $request_filename;
97+ include /etc/nginx/globals/php-fpm.conf;
98+ }
99+ }
100+
101+ # phpinfo - PHP information page
102+ location /phpinfo {
103+ alias /var/www/admin/tools/phpinfo;
104+ index index.php;
105+
106+ location ~ \.php$ {
107+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
108+ fastcgi_param SCRIPT_FILENAME $request_filename;
109+ include /etc/nginx/globals/php-fpm.conf;
110+ }
111+ }
112+
113+ # Adminer - Lightweight database management tool
114+ location /adminer {
115+ alias /var/www/admin/tools/adminer;
116+ index index.php;
117+
118+ location ~ \.php$ {
119+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
120+ fastcgi_param SCRIPT_FILENAME $request_filename;
121+ include /etc/nginx/globals/php-fpm.conf;
122+ }
123+ }
124+
125+ # OpCache GUI - PHP OpCache status and management
126+ location /opcache-gui {
127+ alias /var/www/admin/tools/opcache-gui;
128+ index index.php;
129+
130+ location ~ \.php$ {
131+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
132+ fastcgi_param SCRIPT_FILENAME $request_filename;
133+ include /etc/nginx/globals/php-fpm.conf;
134+ }
135+ }
136+
137+ # PHP processing for control panel root
56138 location ~ \.php$ {
57139 # Regex to split $uri to $fastcgi_script_name and $fastcgi_path
58140 fastcgi_split_path_info ^(.+\.php)(/.+)$;
@@ -64,4 +146,4 @@ server {
64146 # Access log is enabled just for the admin subdomain for security auditing purposes.
65147 access_log /var/log/domains/admin.YOURDOMAIN-nginx-access.log main buffer=128k flush=5m;
66148 error_log /var/log/domains/admin.YOURDOMAIN-nginx-error.log error;
67- }
149+ }
0 commit comments