Created
September 3, 2013 21:00
-
-
Save tsolar/6429503 to your computer and use it in GitHub Desktop.
phpmyadmin nginx config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location /phpmyadmin { | |
root /usr/share/; | |
index index.php index.html index.htm; | |
location ~ ^/phpmyadmin/(.+\.php)$ { | |
try_files $uri =404; | |
root /usr/share/; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
} | |
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { | |
root /usr/share/; | |
} | |
} | |
location /phpMyAdmin { | |
rewrite ^/* /phpmyadmin last; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, I've been using this gist for many years and it's working great.
phpmyadmin recently has changed its document root, and in version 6 it now properly uses a "public" subdirectory to expose its public files. There's also a nice redirect to ensure BC, but I find it a bit annoying and I'd love to be able to configure my location to serve files directly from that public dir.
I've tried the following, but hit a 404 wall. Do you have any suggestions? TIA