Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx installation-reverse proxy-load balancing-static and dynamic separation

2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Installation

1. Need material

The last two download and install with the command

Openssl-1.0.1t.tar.gz

Zlib-1.2.8.tar.gz

2: put the two files "nginx-1.16.1.tar.gz" and "pcre-8.37.tar.gz" in / usr/src/ and extract them.

Then under the pcre-8.37 file, first:. / configure is typing make & & make install

Pcre-conffig-- verison view version

Next, install nginx to enter nginx-1.16.1. / configure is knocking on make & & make install

After the installation is complete, there is an extra local/nginx in usr, and there is sbin and startup script in nginx

. / nginx start

. / nginx-s reload restart

. / nginx-s stop is forced to close and may not save things; quit

. / nginx-v check the version number

Reverse proxy

Load balancing

Dynamic and static separation

In Web development, generally speaking, dynamic resources actually refer to those background resources, while static resources refer to files such as HTML,JavaScript,CSS,img.

Generally speaking, it is necessary to separate dynamic resources from static resources and deploy static resources on Nginx. When a request comes, if it is a request for static resources, it will go directly to the static resource directory configured by nginx to obtain resources. If it is a request for dynamic resources, nginx uses the principle of reverse proxy to forward the request to the background application for processing, so as to achieve static and dynamic separation.

After using the front-end separation, the access speed of static resources can be greatly improved. At the same time, in the opening process, the front-end development parallel can effectively improve the development time, and some can reduce the co-tuning time.

I have a simple configuration here.

First create a folder / data/ under the root directory, and then create two files image and www below

Text

Then we go to the / usr/local/nginx/conf directory

Edit nginx.conf

Then restart nginx

Visit

Text

The last omission

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report