Created
March 25, 2019 16:00
-
-
Save irgendwr/187a64ffc87e73ce198921e0214cd768 to your computer and use it in GitHub Desktop.
Nginx snippet for serving phpmyadmin in a custom subdirectory
This file contains 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
location /pma { | |
alias /usr/share/phpmyadmin; | |
try_files $uri $uri/ @pma =404; | |
location ~ \.php$ { | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $request_filename; | |
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # <-- change this to fit your installation | |
} | |
} | |
location @pma { | |
rewrite /pma/(.*)$ /pma/index.php?/$1 last; | |
} | |
# based on: https://serversforhackers.com/c/nginx-php-in-subdirectory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet saved my life! Thanks 🎉