Nginx configuration file Simple description

Source: Internet
Author: User
Tags epoll
Configuration file ( Description)

User nginx; Nginx the running Account ( This account will be created automatically when RPM is installed ), can also be written User Nginx Nginx represents users and Groups

Worker_processes ; number of worker processes (worker), generally equals CPU number of cores or twice times

worker_rlimit_nofile 100000; File Descriptor Quantity

Error_log /var/log/nginx/error.log;

#error_log /var/log/nginx/error.log Notice

#error_log /var/log/nginx/error.log Info

Pid /var/run/nginx.pid;

Events {

Worker_connections 1024x768; each worker number of connections allowed by the process

Use epoll; Network I/O Event Model , Linux Recommended for Epoll,freebsd Recommended for Kqueue

}

HTTP {

Include /etc/nginx/mime.types; include used to refer to other configuration files , that is, you can write different configurations to different files according to your requirements.

Default_type Application/octet-stream;

Log_format Main ' $remote _addr-$remote _user [$time _local] "$request" '

' $status $body _bytes_sent ' $http _referer '

' "$http _user_agent" "$http _x_forwarded_for";

Defining log Formats , format name is set to Main

Access_log /var/log/nginx/access.log Main

Access path to the log file , using the above defined Main format Record

Sendfile On

Tcp_nopush On

Tcp_nodelay On

Server_tokens Off

gzip on; Enable compression

Gzip_static on; enabled httpgzipstatic Module ( not in core and standard module groups , but rpm installation with this module )

Gzip_comp_level 5; compression Level , 1 the smallest and fastest , 9 the largest and slowest

Gzip_min_length 1024x768; minimum length of compression , less than this length of no compression ( This length is The content-length in the header )

Keepalive_timeout 65;

Limit_zone MyZone $binary _remote_addr 10m;

# Load config files from the/etc/nginx/conf.d directory

include/etc/nginx/conf.d/*.conf;

server {

Limit_conn MyZone 10;

Listen 80; Port

server_name _; Domain name

#charset koi8-r;

#access_log logs/host.access.log main;

location/{

root /usr/share/nginx/html; home directory

index index.html index.htm;

}

..................

Above describes the Nginx configuration file simple description, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.