For static web sites have the public need to include, and do not want to use dynamic Web pages to write, then shtml is the best choice. sHTML can contain the specified file to a document similar to the Include feature in PHP.
Nginx itself has supported shtml format file resolution, but is not enabled by default and needs to be manually turned on.
Open the Nginx configuration file nginx.conf and add the following three sentences to HTTP.
Copy Code code as follows:
# vi/usr/local/nginx/conf/nginx.conf
Add the following code to the http{}:
Copy Code code as follows:
SSI on;
Ssi_silent_errors on;
Ssi_types text/shtml;
PS. Here the file type can be changed to other, for example, let HTM also support SSI, then change the text/shtml to text/htm on the line, but in this case, because the server htm more files, it is not necessarily all using SSI to introduce other pages, Will cause some unnecessary consumption to the nginx, so it is not recommended to do so.
Save the reboot Nginx.
If you need to add a default home page, you can find the index option in nginx.conf and write
Copy Code code as follows:
Index index.shtml index.html index.htm
Save the reboot Nginx.