Set up access verification for the Site directory after we enter this page will need to enter the authentication password, I would like to introduce the Nginx Directory access authentication Code method summary.
1. Create Class HTPASSWD files
Nginx is one of the most popular Web servers today. It provides services to 7% of the world's web traffic and is growing at an alarming rate. It's a surprising server and I'm willing to deploy it.
Here is a list of common security traps and
Nginx 1.3.13 has been released, which supports the Connection:upgrade and upgrade headers, which means supporting the websocket agent. Many people are waiting for this new feature so that "Nginx support WebSockets?" became f The most frequently
1. First, add the corresponding header file of the ImageMagick library to the environment variable.
Copy Code code as follows:
Export C_include_path= $C _include_path:/usr/local/imagemagick/include/imagemagick/
The following
High-level configurationin the nginx.conf file, a few of the advanced configurations in Nginx are above the module section.User Www-data;Pid/var/run/nginx.pid; worker_processes Auto;Worker_rlimit_nofile 100000;
The user and PID should be set by
Nginx relies on software libraries to ensure that the system installs GCC, SSL, pcre, and Gzip software prior to installation, and can use the RPM-Q command to see if the software is installed.
[Root@redhat1 ~]# rpm-q gccGcc-4.1.2-44.el5
The
Recently deployed a project Html,js normal loading, CSS also did not report 404,css can normally get, but the browser can not parse, the study found that the original is configured Nginx when the/etc/nginx/nginx.conf line include/etc/
Generate certificateyou can generate a simple certificate by using the following steps:First, enter the directory where you want to create the certificate and private key, for example:
$ cd/usr/local/nginx/conf
Create the server
In Nginx to ban one or a class of resources, you only need to add a location and then use Deny all in it.
Prohibit access to files with the extension bat, configured as follows:
Location ~*/.bat {
deny all;
}
Prohibit access to the
Nginx implementation of static compression is actually like the Apache gzip compression, this compression is common to some of the things we have, the following I introduce some practices.
In the construction of Squid Web page acceleration, for
The first step is to apply for a local certificate
1. OpenSSL, such as software I do not say that the system itself, if not with, their own yum under
[Root@e2fsck ~]# OpenSSL genrsa-des3-out e2fsck.org.key 2048 generating RSA private key, 1024
I use Nginx to implement the Web site load Balancing test example, Windows IIS do load measurement.
If your site traffic (PV) more and more high, a server has no way to withstand the flow of pressure, then increase the number of Web servers to do
Nginx Agent done, the cache is also configured, but found that CSS, JS, jpg these static files are all cached success. But the page file is still to the source server.1. Nginx does not cache reasonby default, whether the cache is nginx by the Nginx
Nginx-http-footer-filter Presumably everyone feels very strange, then we come to know it, this is the nginx of Taobao development module. It is used to nginx append content at the bottom of the response request file. Today, the time to study the
After searching and testing on the Internet, it is found that the rewrite rules of Nginx and the Rewite rules of Apache are not very different, and can be used almost directly. Like writing rules like this in Apache.
Rewrite ^/([0-9]{5}).
Install Nginx
sudo apt-get install Nginx
If you have Apache installed, and Apache is running at this time, please modify the configuration file first (no students skip directly):
#打开配置文件
sudo
The default nginx does not support TCP load balancing, need to be patched, (connect by: Receive a connection from the client, will initiate a new connection from the local to the back-end server), the specific configuration is as follows:
I.
The download server is often hotlinking, and the time has long caused the server to waste a lot of resources, because the server uses Nginx as a Web server. Nginx anti-theft Chain Method There are many, can use off-the-shelf anti-theft chain module
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.