php-fpm can not use html as php

I have a site, which use nginx as web server and php-fpm as php interpreter. Most of the files use html extension name.

My nginx conf file has following section.

location ~ \.html|php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

But, when I enter the url such as https://example.com/sample.html, whose content is php script. It did not work.

The solution is to change the config of php.

SSH to the VPS.
Edit /etc/php/7.1/fpm/pool.d/www.conf
Find the security.limit_extensions and uncomment it, add html at the end.

security.limit_extensions = .php .php3 .php4 .php5 .php7 .html

After it, reload nginx, all done.