Kaynağa Gözat

Update phpmyadmin.inc (#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>
Alber Khan 1 yıl önce
ebeveyn
işleme
c3328c4a4d

+ 2 - 1
install/deb/nginx/phpmyadmin.inc

@@ -20,7 +20,8 @@ location /%pma_alias% {
 		fastcgi_pass  127.0.0.1:9000;
 	}
 
+	# Serve static files like CSS and JS
 	location /%pma_alias%/(.+\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
-		root /usr/share/phpmyadmin/;
+		alias /usr/share/phpmyadmin/;
 	}
 }

+ 3 - 2
install/rpm/nginx/phpmyadmin.inc

@@ -20,7 +20,8 @@ location /%pma_alias% {
 		fastcgi_pass  127.0.0.1:9000;
 	}
 
-	location /%pma_alias%/(.+\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
-		root /usr/share/phpmyadmin/;
+	# Serve static files like CSS and JS
+	location ~ ^/%pma_alias%/(.*\.(jpg|jpeg|gif|css|png|webp|js|ico|html|xml|txt))$ {
+		alias /usr/share/phpmyadmin/$1; # Corrected from root to alias
 	}
 }