Skip to content

Instantly share code, notes, and snippets.

@gr1zix
Last active March 23, 2020 01:03
Show Gist options
  • Save gr1zix/05ad66085b115ea064fb94275533a8c1 to your computer and use it in GitHub Desktop.
Save gr1zix/05ad66085b115ea064fb94275533a8c1 to your computer and use it in GitHub Desktop.
phpmyadmin
location /phpmyadmin {
#Auth
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/pma_pass;
expires modified +310s;
#Context
root /usr/share/;
index index.php;
try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(doc|sql|setup)/ {
deny all;
}
location ~ /phpmyadmin/(.+\.php)$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|png|ico|css|js|html|xml|text))$ {
root /usr/share/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment