Nginx+ssi Combination Configuration

Source: Internet
Author: User

What is SSI (Server Side includes)?
If you've ever used Apache, you should know that it enables static Web pages to include features like dynamic Web pages, as well as some simple syntax
Nginx comes with SSI by default.

In the Nginx open SSI, add the following 3 lines is OK, can be placed in the HTTP, server, and Location section are line

HTTP {
SSI on;
Ssi_silent_errors on;
Ssi_types text/shtml;
Include Mime.types;
Default_type Application/octet-stream;

Or

server {
SSI on;
Ssi_silent_errors on;
Ssi_types text/shtml;
Listen 80;
server_name localhost;


Or

Location =/50x.html {
SSI on;
Ssi_silent_errors on;
Ssi_types text/shtml;
root HTML;

Three domains are configured. SSI on;
Ssi_silent_errors on;
Ssi_types text/shtml;

Examples of Use methods: <p>21andy.com Nginx + ssi</p>
<!--# include file= "/tmp/test.html"-

Note the problem with the path, not the absolute path of the hard disk, but the absolute path of the site

But I saw in the official document that SSI had a problem, that last-modified and Content-length would not send
That's when SSI was enabled the last-modified and content-lengthheaders are not sent
Actually tested it, indeed, alas, the ointment.

Nginx built-in module with cache memory Nginxhttpmemcachedmodule

, which can support a simple cache. Nginx+ssi+memcached is currently a popular architecture in pursuit of high-performance trends, leveraging server-side scripting to process access requests and retrieve data from memcache or directly from the backend. Where SSI is Serversideincludes, the Chinese translation is server-side included, which provides a way to add dynamic content to existing HTML documents. It is gratifying to note that Nginx also has a built-in SSI module NGX_HTTP_SSI_MODULE.

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.