The contents of the 1:nginx.conf file are as follows:
Worker_processes 4; Refers to a 4-core CPU
Events {
Worker_connections 65535; Linux under ulimit-n view parameter matching
}
HTTP {
Include Mime.types;
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";
Sendfile on;//Transfer File acceleration
Keepalive_timeout 30;//Visit website wait time
Client_max_body_size 6m;//max upload file size
Gzip on;//text File compression transfer
include/opt/nginx/conf/vhost/*;//includes multiple configured Web sites, for example: B2b.conf and auto.conf
}
The contents of the 2:b2b.conf file are as follows:
server {
Listen 80;
server_name www.b2bxxx.cn b2bxxx.cn;
Location/{//homepage
Root/opt/huahuionline;
Index index.html index.htm;
}
Location ^~/static/{//static file
root/opt;
}
Location ~. *$ {
Proxy_pass http://127.0.0.1:22; Dynamic program Jump
}
Location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|mp4) $ {
Expires 60d;//cache for 60 days
}
Location ~. *\. (JS|CSS)? $ {
Expires 3h;//cache for 3 hours
}
Location ~. *\. (HTML)? $ {
Expires 5m;//cache for 5 minutes
}
Access_log/opt/nginx/logs/b2b.log; Default Access.log
error_log/opt/nginx/logs/b2b_err.log;//default Error.log
}
3:auto.conf content is as follows:
server {
Listen 80;
server_name Www.autodesign.club Autodesign.club;
Location ^~/auto_static/{
root/opt;
}
Location ~. *$ {
Proxy_pass http://127.0.0.1:33; The port is not the same as above
Rewrite ^/$/mainctrl?page=indexpage last; Home Jump
}
Location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|mp4) $ {
Expires 60d;
}
Location ~. *\. (JS|CSS)? $ {
Expires 3h;
}
Access_log/opt/nginx/logs/auto.log;
Error_log/opt/nginx/logs/auto_err.log;
}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the nginxconf configuration instructions, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.