############################### Nginx. conf configuration file description # user nobody; # The user main module command instructs nginx worker to run users and user groups (User xxxuser xxxgroup). By default, worker_processes 1 is run by nobody; # worker_processes main module command, command number of processes running nginx, each process consumes an average of 10 m-12m memory, 1 single core, N # error_log logs/error. log; # global log output levels: Debug, info, notice, warn, error, and crit. Among them, debug output logs are the most detailed # error_log logs/error. log notice; # level notice # error_log logs/error. log Info; # level info # PID logs /Nginx. PID; # PID command specifies the process ID storage location events {worker_connections 1024; # events command nginx working mode and connection limit} HTTP {# HTTP server configuration include mime. types; # contains the file mime. types default_type application/octet-stream; # The default value is binary stream # log format setting # log_format main '$ remote_addr-$ remote_user [$ time_local] "$ request"' # commands of the httplog module and log output format, main is the log name, which can be referenced in the access_log command # '$ Status $ body_bytes_sent "$ http_referer"' # '"$ http_user_agent" "$ HTTP _ X_forwarded_for "'; # access_log logs/access. log main; sendfile on; # efficient file transmission mode. Set tcp_nopush and tcp_nodely to on # tcp_nopush on; # keepalive_timeout 0; # timeout time for client connection persistence, disconnect keepalive_timeout 65 after timeout; # gzip on; # enable gzip compression to compress the output data stream in real time # configure Server {Listen 80; # port SERVER_NAME localhost; # IP or domain name, multiple www.abc.com, 127.0.0.1 # charset koi8-r; # encoding format # access_log logs/host. access. log main; # location/ {Root HTML; index index.html index.htm;} # error_page 404/404 .html; # redirect server error pages to the static page/50x.html # error_page 500 502 503 504/50 x.html; location =/50x.html {root HTML;} # proxy the PHP scripts to Apache listening on 127.0.0.1: 80 # location ~ \. Php $ {# proxy_pass http: // 127.0.0.1; #}# pass the PHP scripts to FastCGI server listening on 127.0.0.1: 9000 # location ~ \. PHP $ {# Root HTML; # fastcgi_pass 127.0.0.1: 9000; # fastcgi_index index. PHP; # fastcgi_param script_filename/scripts $ fastcgi_script_name; # include fastcgi_params; #}# deny access. htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\. HT {# deny all ;#}# another virtual host using mix of IP-, name-, and port-based configuration # server {# listen 8000; # Listen somename: 8080; # SERVER_NAME somename alias another. alias; # location/{# Root HTML; # index index.html index.htm; #}#}# https server # server {# Listen 443; # SERVER_NAME localhost; # SSL on; # ssl_certificate cert. PEM; # ssl_certificate_key cert. key ;# Ssl_session_timeout 5 m; # ssl_protocols SSLv2 SSLv3 tlsv1; # ssl_ciphers high :! Anull :! MD5; # ssl_prefer_server_ciphers on; # location/{# Root HTML; # index index.html index.htm ;#}#}}