server {
	listen   80;
	listen   [::]:80;

	root /var/www/html/;
	index index.php;
	server_name localhost;

	location / {
		try_files $uri $uri/ /index.php;
	}

    location /media/ {
	autoindex on;
	}

    location ~ [^/]\.php(/|$) {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            if (!-f $document_root$fastcgi_script_name) {
                    return 404;
            }
            fastcgi_pass unix:/run/php/php7.3-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
			fastcgi_param REMOTE_USER $remote_user;
            #auth_basic "Restricted";
            # auth_basic_user_file /usr/local/.htpasswd;
            }
	location ~ /\.ht {
		deny all;
	}
}
