separating movement simple example implementation nginx

What is the static and dynamic separation?

Nginx static and dynamic separation is simply to separate dynamic and static requests can not be understood as just the dynamic pages and static pages physical separation. Strictly speaking requests should be separate dynamic and static requests can be understood as using nginx handle static pages, tomcat handle static pages. Static and dynamic separation to achieve lower from the current roughly divided into two terms,

One is the purely static files into separate independent domain name, on a separate server, is currently the mainstream respected program.

Another way is dynamic or static files together with the release, be separated by nginx.

First, what to do?

 

 

Second, what to do?

1. Preparations

1.1 Preparation static resources in the Linux system to access

Created in the root directory linux data folder, create two folders in the www and image data folders, one for the put HTML page, a place for pictures

www file into a.html files, image files into the picture 1.jpg

2. Specific Configuration

1.1 in nginx configuration file

 Open /usr/local/nginx/conf/nginx.conf

 

 1.2 test

 

 * Because of the increase in autoindex on the location; it will be displayed here in the folder directory

 

Guess you like

Origin www.cnblogs.com/BeenTogether/p/11619421.html