Skip to content

Instantly share code, notes, and snippets.

@diproart
Last active October 13, 2015 14:28
Show Gist options
  • Select an option

  • Save diproart/6affdf649ed02c7208c2 to your computer and use it in GitHub Desktop.

Select an option

Save diproart/6affdf649ed02c7208c2 to your computer and use it in GitHub Desktop.
PhpMyAdmin / Nginx
# in default server
server {
listen 8080;
client_max_body_size 1024M;
client_body_buffer_size 4M;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE "mbstring.func_overload = 0";
}
# $ cd /usr/share/nginx/html
# $ sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html
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_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
# off mbstring
fastcgi_param PHP_VALUE "mbstring.func_overload = 0";
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment