Skip to content

Instantly share code, notes, and snippets.

@RoccoHoward
Last active December 5, 2017 03:23
Show Gist options
  • Save RoccoHoward/b1e8feaf34033fb525bbe6f3fb5e96bf to your computer and use it in GitHub Desktop.
Save RoccoHoward/b1e8feaf34033fb525bbe6f3fb5e96bf to your computer and use it in GitHub Desktop.
nginx-phpmyadmin-conf
server {
listen 80;
server_name db;
root /usr/share/phpmyadmin;
index index.php;
access_log off;
error_log /var/log/nginx/db.error.log error;
error_log /var/log/nginx/db.debug.log debug;
location = favicon.ico {
log_not_found off;
access_log off;
}
location = robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# Remove trailing slash to please routing system.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
sendfile off;
client_max_body_size 100m;
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment