Skip to content

Instantly share code, notes, and snippets.

@repodevs
Created September 16, 2017 04:40
Show Gist options
  • Save repodevs/8fdb14129a67963bf610f84192d5a485 to your computer and use it in GitHub Desktop.
Save repodevs/8fdb14129a67963bf610f84192d5a485 to your computer and use it in GitHub Desktop.
nginx PhpMyAdmin config example
# /etc/nginx/phpmyadmin.conf
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/php/php7.0-fpm.sock;
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/;
}
}
# /etc/nginx/sites-enabled/wordpress.conf
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/wordpress;
index index.php index.html index.htm;
server_name wordpress.localdev;
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
include phpmyadmin;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment