### IMPORTANT ### If phpMyAdmin is accessed via a different port ### as in the case of a Varnish -> Nginx setup, please do the following ### SET $cfg['PmaAbsoluteUri'] = 'http://your.domain.com/path/to/phpmyadmin/'; in config.inc.php ### Ref: http://serverfault.com/questions/246300/running-phpmyadmin-on-nginx-port-8080-passed-to-varnish-not-working-well ### Ref: http://sourceforge.net/tracker/index.php?func=detail&aid=1340187&group_id=23067&atid=377409 # http => https server { listen 80; listen [::]:80; # IPv6 support server_name pma.example.com; # Replace the path with the actual path to WordPress core files root /home/username/sites/pma.example.com/public; # for LetsEncrypt location ^~ /.well-known/acme-challenge { auth_basic off; try_files $uri =404; expires -1; } location / { return 301 https://$host$request_uri; } } server { listen 443 ssl http2; server_name pma.example.com; index index.php; # Replace the path with the actual path to Phpmyadmin core files root /home/username/sites/pma.example.com/public; access_log /var/log/nginx/pma.example.com-access.log combined buffer=64k flush=5m if=$loggable; # $loggable is defined in conf.d/common.conf error_log /var/log/nginx/pma.example.com-error.log; ssl_certificate "/etc/letsencrypt/live/pma.example.com/fullchain.pem"; ssl_certificate_key "/etc/letsencrypt/live/pma.example.com/privkey.pem"; include globals/restrictions.conf; include globals/assets.conf; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } # Mitigate https://httpoxy.org/ vulnerabilities fastcgi_param HTTP_PROXY ""; include "fastcgi_params"; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; fastcgi_pass fpm; } location / { try_files $uri $uri/ /index.php$is_args$args; } }