1: The content of the nginx.conf file is as follows:
worker_processes 4; //Refers to 4-core cpu
events {
worker_connections 65535; //Ulimit -n under Linux to 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" ';
keepalive_timeout 30;//Waiting time for accessing the website
client_max_body_size 6m;//Maximum upload file size
include/opt/ nginx/conf/vhost/*;//Includes multiple configured websites, the following are examples: b2b.conf and auto.conf
}
listen 80;
server_name www.b2bxxx.cn b2bxxx.cn ;
Home page
root /opt;
location ~ .*$ {
proxy_pass http://127.0.0.1:22; //Dynamic program jump }
location ~ .*.(gif|jpg|jpeg|p ng |bmp|swf|mp4)$ {
Expires 5M; // Caches 5 minutes}
acces_log /opt/nginx/logs/b2b.log; // The default accept.log
}
3: The content of auto.conf 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 different from the one above
rewrite ^/$ /MainCtrl?page=IndexPage last; //Home page Jump
location ~ .*.( )?$ {
expires 3h;
access_log /opt/nginx/logs/auto.log;
error_log /opt/nginx/logs/auto_err.log;
}
Copyright statement: This article is an original article by the blogger and has not been authorized by the author. Reprinting is not allowed with the permission of the blogger.