NGINX server conf to run static site with PMAD with PHP-FPM 7.2

Home   »   NGINX server conf to run static site with PMAD with PHP-FPM 7.2

server {
        listen 80 default_server;
        root /var/www/html;
        index index.html index.htm index.nginx-debian.html index.php;
        server_name server_name 127.0.0.1;
                                            

        location = /favicon.ico { access_log off; log_not_found off; }
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

        location /pmad {
            try_files $uri$args $uri$args/ /phpmyadmin/index.php;
        }

        location / {
            try_files $uri$args $uri$args/ /index.html;
        }

        error_log /var/log/nginx/error.log debug;
}

Leave a Reply

Your email address will not be published. Required fields are marked *