Apache and Nginx Support SSI configuration

Source: Internet
Author: User

I. Preface

SSI is a server-based Web authoring technology that is similar to ASP. Before you send content to your browser, you can use the server-side include (SSI) directive to include text, graphics, or application information in a Web page. For example, you can use SSI to include a time/date stamp, a copyright notice, or a form for customers to fill out and return. For text or graphics that appear repeatedly in multiple files, it is an easy way to use include files. Save the content in one of the included files without having to enter the content into all the 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. Because files containing SSI directives require special processing, SSI file extensions must be assigned to all SSI files. The default extension is. stm,. shtm, and. shtml

two. Apache Configuration

Apache does not support SSI by default, the following can be done under Apache: Modify the Apache configuration file httpd.conf 1. Confirm loading the Include.so module and remove the comment:

LoadModule include_module libexec/apache2/mod_include.so

2. The AddType section removes the two notes:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

3. Directory directories permissions found inside

Options Indexes FollowSymLinks
增加Includes修改为:
Options Indexes FollowSymLinks Includes

4. Restart Apache

three. Nginx Configuration

1. Instructions: SSI Syntax: SSI [on | off] Default: SSI off Configuration segment: HTTP, server, location, if SSI processing is enabled. [WARNING] Note if SSI is enabled, then last-modified headers and content-length headers are not delivered. [/warning]

Ssi_silent_errors syntax: ssi_silent_errors [On|off] Default: Ssi_silent_errors off Configuration segment: HTTP, server, location if it occurs during the process of SSI "[ An error occurred while processing the directive] "bug that disables its output.

Ssi_types syntax: ssi_types mime-type [Mime-type ...] default: Ssi_types text/html Configuration segment: HTTP, server, location by default only the text/html type is resolved, This parameter can specify a different MIME type.

Ssi_value_length Syntax: ssi_value_length length Default value: Ssi_value_length 256 configuration segment: HTTP, server, location defines the length of the parameter values that are allowed for SSI to use.

2. Under Nginx do the following settings:

Apache and Nginx Support SSI configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.