directly, that is, return 403, which saves resources.II: Nginx access controlTo restrict access to only one IP, add the following configuration:Allow 192.168.1.101;Deny all;Prohibit an IP or IP segment access to the site's setup method, first establish the following configuration file placed in the Nginx confUnder directory, named Deny.ipCat Deny.ipDeny 192.168.1.11;Deny 192.168.1.123;Deny 10.0.1.0/24;In t
Nginx anti-theft chain first into the/usr/local/nginx/conf/vhost/directory, edit the configuration file vim Test.com.confvim test.com.conf then the contents of the following location ~ ^.+. (Gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls) ${expires 7d; valid_referers None blocked Server_names . test.com; if ($invalid _referer) {return 403;} Access_log of
After coding, let's compile and compile the configuration file config to copy an open-source extension format. Just modify it.
ngx_addon_name=ngx_http_hello_ydw_moduleHTTP_MODULES="$HTTP_MODULES ngx_http_hello_ydw_module"NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_hello_ydw_module.c"
The code configuration file has been written. Now we have created a folder named ngx_http_hello_ydw_module to store the config and ngx_http_hello_ydw_module.c. The structure is as follows. Our mod
reload the configuration file (see the reload command above). This is the same as Apache (many people say that you need to restart Apache after changing the configuration file, in fact, you don't have to. You only need to reload the configuration file to take effect, which is very fast and will not cause service interruption ).
After nginx is installed, it is not registered as a system service by default. Therefore, you need to manually add a
oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful[[emailprotected] ~]# /usr/local/nginx/sbin/nginx -s reloadView results againCan parse normally3. If you encounter 502 of the situation:location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/tmp/php-fgi.sock;
a1c052f8
gpg:can ' t check signature:no public keyImport Public Key IDGPG--keyserver keys.gnupg.net--recv-key a1c052f8Verify againGPG--verify NGINX-1.10.2.TAR.GZ.ASCSeeing a red font indicates successful validationGpg:signature made Tue Oct 23:04:49 CST using RSA key ID A1c052f8Gpg:good signature from "Maxim dounin Gpg:WARNING:This key isn't certified with a trusted signature!Gpg:there is no indication, the signature belongs to the owner.Primary key
install nginx.
1: tar -zxvf nginx-1.7.7.tar.gz
2: cd nginx-1.7.7
3: ./configure
4: sudo make
5: sudo make install
3. Nginx configuration file
Follow the above steps to install Nginx. Because we use the default configure/usr/local/nginxDirect
Reprint please indicate source: http://blog.csdn.net/loongshawn/article/details/51413031
Related articles:
"Nginx Address Jump"
1. Background
Sometimes a server deploys both Nginx and other Web services, which in turn consumes 80 of the server's port, and the Web service uses a non-80 port.
Like this website: http://104.69.205.247:8086, its port is 8086, but if this site needs to give him a whole
the message to the Nginx main process, so that the main process of Nginx will reopen the log. Otherwise the log will continue to be written to the path after MV KILL-USR1 ' PS Axu | grep "nginx:master process" | Grep-v grep | awk ' {print $} ' ' cd ${dest_log_path} #进入日志的路径, query the log before the day before, and then delete it. find. -mtime + 7 -name "*20[1-9][3-9]*" |xargs rm-rf exit 0
First, the user on the dynamic PHP Web Access processUser browser initiates access to a webpage: http://192.168.1.103/index.phpUser and Nginx server three handshake for TCP connection (ignoring including Nginx access control policy, Nginx Firewall and other access control policies)First step: the user sends an HTTP request to the
Nginx start, close, and reload the script, and nginx start and load the script
#! /bin/sh# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: starts the nginx web serverPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binDESC="nginx daemon"NAME=nginxDAEMON=/usr/local/
First, nginx anti-theft chainThe configuration is as follows and can be combined with the above configuration.Location ~* ^.+\. (Gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls) ${Expires 7d;Valid_referers none blocked Server_names *.test.com;if ($invalid _referer){return 403;}Access_log off;}Second, Nginx access controlRequirements: Access to the/admin/directory request, only a few IP access is all
items as follows:
work_threads=8
store_path_count=1
Base_path=/usr/local/src/fastdfs/storage
Store_path0=/usr/local/src/fastdfs/storage
# #tracker_server Address
tracker_server=20.10.80.17:22122
if it is multiple tracker_server, write more directly, as shown below
# #运行 Fastdfs user Group
Run_by_group=root
# #运行 users of Fastdfs
Run_by_user=root
file_distribute_path_mode=1
rotate_error_log=true
4.3 integrating the Fastdfs-nginx-module module mod_f
Nginx main configuration parameters, Nginx configuration website, and nginx Parameters1. Detailed description of parameters in the main configuration file
A. Install nginx in Linux. Blog address: http://www.cnblogs.com/cindy-cindy/p/6847499.html
B. after Nginx is installed,
PHP Programmer One, this environment is a personal note bar, posted out
Environment:
CentOS 5.5
The mirror address will not be posted.
php-5.4.20
Address: http://museum.php.net/php5/php-5.4.20.tar.gz
Mysql-5.. 5.48 (Universal binary format)
Address: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.48-linux2.6-i686.tar.gz
nginx-1.8.1
Address: http://nginx.org/download/nginx-1.8.1.tar.gz
First, compil
into the file: Note that the Red section is modified to your path, nginxd value is the Nginx path to start Nginx, nginx_config value is Nginx profile nginx.conf path, nginx_ The PID value is the path of the Nginx.pid, if installed according to my method, is in the Nginx installation directory logs inside the
#!/bin/ba
processing of the SSL protocol. Users can use the commands provided by OpenSSL to see if there is an SSL hardware acceleration device: OpenSSL engine-t
Frequency of execution of system call Gettimeofday
Syntax: Timer_resolution t;Role: By default, each time the kernel's event calls (such as epoll,select,poll,kqueue, etc.) are returned, the gettimeofday is executed once, implementing the kernel's clock to update the
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.