Nginx server configuration

Source: Internet
Author: User
Main parameters of Nginx server configuration: worker_processes16; worker Nginx server configuration main parameters: worker_processes 16; worker_cpu_affinity 0000000000000001 0000000000000010 0000000000000100 0000000000001000 0000000000010000 0000000000100000 0000000001000000 0000000010000000 0000000100000000 0000001000000000 00 0000100000000000 0001000000000000 0010000000000000 0100000000000000 1000000000000000; www.2cto.com worker_rlimit_nofile 1024000; pid logs/nginx. pid; events {use epoll; worker_connections 1024000;} default_type application/octet-stream; limit 128; limit 32 k; limit 4 32 k; client_max_body_size 8 m; sendfile on; www.2cto.com tcp_nop Ush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; limit 300; limit 64 k; fastcgi_buffers 4 64 k; limit 128 k; limit 128 k; open_file_cache max = 1024000 inactive = 60 s; open_file_cache_min_uses 1; open_file_cache_valid 30 s; ## cache ## proxy_connect_timeout 5; proxy_read_timeout 60; pro Xy_send_timeout 5; proxy_buffer_size 16 k; proxy_buffers 4 64 k; limit 128 k; limit 128 k; proxy_temp_path tmp/temp_dir; export tmp/cache levels = keys_zone = cache_one: 200 m inactive = 1d max_size = 30g; ## end ### gzip on; gzip_min_length 1 k; gzip_buffers 4 16 k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript Text/css application/xml; gzip_vary on; www.2cto.com upstream in_pool {# ip_hash; server 192.168.0.3: 8080; server 192.168.0.6: 8080 backup; server 192.168.0.9: 8080 backup;} server {listen 80; server_name 192.168.60.30; # charset KOI8-R; location ~. * \. (Gif | jpg | png | htm | html | css | js | flv | ico | swf) (. *) {proxy_pass http://interface_pool ; Proxy_redirect off; proxy_set_header Host $ host; proxy_cache cache_one; proxy_cache_valid 200 302 1 h; limit 301 1d; proxy_cache_valid any 1 m; expires 30d;} www.2cto.com location ~. * \. (Php) (. *) {proxy_pass http://interface_pool ; Proxy_set_header Host $ host; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;} location ~. * \. (Jsp) (. *) {proxy_pass http://interface_pool ; Proxy_set_header Host $ host; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;} author xiaoxin

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.