I. What is SSI
Ssi:server Side Include, is a server-based Web authoring technology, most (especially Unix-based platform) Web servers such as Netscape Enterprise Server support SSI commands.
It works by using an SSI directive to include text, pictures, or code information in a Web page before the page content is sent to the client. For repeating content in multiple files, using SSI is an easy way to save content in an include file without having to enter it into all files. The include file is called with a very simple statement that instructs the WEB server to insert the content into the appropriate Web page. Also, when you use the Include file, all changes to the content can be done in one place only.
Two. How to configure SSI on Nginx
The main options you need are the following three:
SSI: default value off, set to on when SSI is enabled
ssi_silent_errors: default value off, when processing an SSI file error when opening, do not output error "[An error occurred while processing the directive]".
ssi_types: The default is text/html, so if you need to support HTML, you do not need to set this sentence, if you need to support shtml need to set: Ssi_types text/shtml
Three parameters can be placed under the HTTP, server or location scope.
Three. Example
server { listen 10.3.9.27:80; server_name www. Ball. com; / { SSI on; Ssi_silent_errors on; Ssi_types text/shtml; Index index. shtml; /usr/local/web/wwwroot; Expires 30d; Access_log /data/logs/www.ball.com-access_log main; }}
Nginx Configuration SSI