Skip to content

Commit c3328c4

Browse files
Update phpmyadmin.inc (hestiacp#4590)
* Update phpmyadmin.inc The issue with the CSS and JS files not loading may stem from the configuration of the alias directive and how Nginx resolves file paths in a custom template. I changed `root` to `alias` in the CSS and JS location block, as the alias directive is essential for accurately mapping the request URI to the filesystem path. * Update for debian aswell --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent ca6823b commit c3328c4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

install/deb/nginx/phpmyadmin.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ location /%pma_alias% {
2020
fastcgi_pass 127.0.0.1:9000;
2121
}
2222

23+
# Serve static files like CSS and JS
2324
location /%pma_alias%/(.+\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
24-
root /usr/share/phpmyadmin/;
25+
alias /usr/share/phpmyadmin/;
2526
}
2627
}

install/rpm/nginx/phpmyadmin.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ location /%pma_alias% {
2020
fastcgi_pass 127.0.0.1:9000;
2121
}
2222

23-
location /%pma_alias%/(.+\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
24-
root /usr/share/phpmyadmin/;
23+
# Serve static files like CSS and JS
24+
location ~ ^/%pma_alias%/(.*\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
25+
alias /usr/share/phpmyadmin/$1; # Corrected from root to alias
2526
}
2627
}

0 commit comments

Comments
 (0)