Nginx configuration file Chinese comments

Source: Internet
Author: User
Tags imap
Nginx (enginex) is a high-performance HTTP and reverse proxy server and an IMAP/POP3/SMTP proxy server. Nginx is developed by the Rambler.ru site, where IgorSysoev is the second highest traffic in Russia. it has run many times on this site... nginx ("engine x") is a high-performance HTTP and reverse proxy server and an IMAP/POP3/SMTP proxy server. Nginx is developed by the Rambler.ru site with the highest access volume in Russia as Igor Sysoev. it has been running on this site for many years. Igor releases the nginx source code in the form of a class BSD license. The following is a detailed description of the Nginx configuration file: # run the user nobody; # start the process worker_processes 2; # the global error log and the PID file error_log logs/error. log notice; pid logs/nginx. pid; # working mode and maximum number of connections events {use epoll; worker_connections 1024;} # set the http server, using its reverse proxy function, server load balancer supports http {# setting the mime type include conf/mime. types; default_type application/octet-stream; # set the log format log_format main '$ remote_addr-$ remote_user [$ time_local] ''" $ request "$ status $ bytes_sent'' "$ http_re Ferer "" $ http_user_agent "'' "$ gzip_ratio "'; log_format download '$ remote_addr-$ remote_user [$ time_local] ''" $ request "$ status $ bytes_sent'' "$ http_referer" "$ http_user_agent" ''" $ http_range "" $ sent_http_content_range "'; # set request buffer limit 1 k; limit 4 4 4 k; # enable gzip module gzip on; gzip_min_length 1100; gzip_buffers 4 8 k; gzip_types text/plain; output_buffers 1 32 k; postpone_ou Tput 1460; # set access logaccess_log logs/access. log main; client_header_timeout 3 m; client_body_timeout 3 m; send_timeout 3 m; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; # set the server list of server load balancer upstream mysvr {# The weigth parameter indicates the weight value. The higher the weight value, the higher the chance of being allocated to it # enable port 3128 server 192.168.8.1 on Squid on the local machine: 3128 weight = 5; server 192.168.8.2: 80 weight = 1; server 192.168.8.3: 80 weight = 6 ;}# set the virtual host server {listen 80; server_name 192.168.8.1 Www.hahaer.com; charset gb2312; # set the access log access_log logs/www.hahaer.com. access. log main; # If you access/img/*,/js/*,/css/* resources, you can directly retrieve local files without passing squid # if these files are large, this method is not recommended, because the cache effect through squid is better location ~ ^/(Img | js | css)/{root/data3/Html; expires 24 h;} www.2cto.com # enable server load balancer location/{proxy_pass http://mysvr;proxy_redirect Off; proxy_set_header Host $ host; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ timeout; limit 10 m; limit 128 k; proxy_connect_timeout 90; limit 90; proxy_read_timeout 90; proxy_buffer_size 4 k; proxy_buffers 4 32 k; limit 64 k; proxy_temp_file_write_size 64 k;} # set the address location/NginxStatus {stub_s for viewing Nginx status Tatus on; access_log on; auth_basic "NginxStatus"; auth_basic_user_file conf/htpasswd ;}} remarks: the content of the conf/htpasswd file is generated using the htpasswd tool provided by apache. View Nginx running status input address http://192.168.8.1/NginxStatus/ Enter the verification account password and you will see the following content: Active connections: 328 server accepts handled requests9309 8982 28890 Reading: 1 Writing: 3 Waiting: 324 The first line indicates the number of currently active connections. The third number in the third line indicates the total number of requests received from Nginx running to the current time. if the number reaches the upper limit, the upper limit must be increased. The fourth line is the Nginx queue status.
Related Article

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.