A comprehensive introduction to the definition of Nginx server configuration file

  

I don't know what kind of concept everyone has on the server? Ordinary users generally don't care so much, but if you are interested in the server, you should take a good look. Today, this tutorial introduces one of the high-performance servers. Let's learn. Nginx ("engine x") is a high-performance HTTP and reverse proxy server and an IMAP/POP3/SMTP proxy server. Nginx was developed by Igor Sysoev for the second-most visited Rambler.ru site in Russia, which has been running on the site for more than two and a half years. Igor publishes the source code as a class BSD license.

Detailed Nginx Configuration File

#跑用户

user nobody nobody;

#Start Process

worker_processes 2;

#Global error log and PID file

error_log logs/error.log notice;

pid logs/nginx.pid;

#Work mode and connection limit

events {

use epoll;

worker_connections 1024;

}

#设置http服务器, use its reverse The proxy function provides load balancing support

http {

#设置mimetype

include conf/mime.types;

default_type application/octet-stream ;

#设置日志模式

log_format main ‘$remote_addr – $remote_user [$time_local] ‘

‘”$request” $status $ Bytes_sent ‘

‘”$http_referer” “$http_user_agent” ‘

‘”$gzip_ratio”‘;

log_format download ‘$remote_addr – $remote_user [$time_local] ‘

‘”$request” $status $bytes_sent ‘

‘”$http_referer” &ldquo ;$http_user_agent” ‘

‘”$http_range” “$sent_http_content_range”‘;

#设置Request buffer

client_header_buffer_size 1k;

large_client_header_buffers 4 4k;

Copyright © Windows knowledge All Rights Reserved