server {
    listen 80;
    index index.php /_h5ai/public/index.php;
    server_name images.labx8.org; # change to your own domain
    
    root /var/www/images;

    # individual nginx logs for this vhost
    access_log  /var/log/nginx/h5ai.example.com_access.log; # change to your own domain
    error_log   /var/log/nginx/h5ai.example.com_error.log;  # change to your own domain
        
    location /_h5ai/private {
        return 403;
    }

    location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }

    fastcgi_param HTTP_PROXY "";

    fastcgi_pass unix:/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;

    include fastcgi_params;

    fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO         $fastcgi_path_info;
    }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/images.labx8.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/images.labx8.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



}