Skip to content

Instantly share code, notes, and snippets.

@tomatolicious
Created September 24, 2017 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomatolicious/94d4943d12511da8335252ddd30ff49c to your computer and use it in GitHub Desktop.
Save tomatolicious/94d4943d12511da8335252ddd30ff49c to your computer and use it in GitHub Desktop.
Snippet for properly handling all phpMyAdmin cases in NGINX. Collected somewhere from Stack Overflow.
# Phpmyadmin Configurations
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
# Dealing with the uppercased letters
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment