SSI Introduction and Nginx Open SSI

Source: Internet
Author: User

Server Side Include: Servers-side embedding

Rationale: Before sending content to a browser, you can use the server side include (SSI) directive to include text, graphics, or application information in a Web page. 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

Mainly for the following purposes: 1, display server-side environment variables < #echo >2, insert text content directly into the document < #include >3, display information about the Web document < #flastmod #fsize > (such as file date/size, etc.) 4, direct execution of various programs on the server < #exec > (such as CGI or other executable program) 5, set the SSI information display format < #config >; (such as file date/size display method) Advanced ssi< xssi>; can set variables using the IF condition statement. Nginx Open SSI Edit nginx configuration file vi/usr/local/nginx/conf/nginx.conf Add the following code SSI on;ssi_silent_errors on;ssi_types text/shtml; save Restart Nginx I configuration case
Location ~ \.shtml$ {                SSI on;                Ssi_silent_errors on;                Ssi_types text/shtml;        }

Where SSI is applied is the separation of static fragments from the respective gaming websites, which are introduced in SSI's way

<!-- #include file= "head.shtml"  -

Among the setbacks encountered were

The path name of file is written as an access address such as <!--#include file= "http://hejungw.feiliu.com/site/gc/wap/list/head.shtml"--that's not right.

And then write the server-side absolute address such as <!--#include file= "/data0/www/html/hejungw/static/ssi/13/head.shtml"--that's not right.

Finally, the relative address is written correctly.

Include another notation

<!-- #include virtual= "/site/gc/wap/list/head.shtml"  -

Virtual: gives a path to a document on the server side

The virtual path removes the remaining path to the domain name for the URL that accesses the fragment

The URL to access the head fragment in this project is http://hejungw.feiliu.com/site/gc/wap/list/head.shtml

comprehensive to introduce external files with the include virtual is convenient

SSI Introduction and Nginx Open SSI

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.