server {
listen 80;
server_name sp.*;
#charset utf-8;
location / {
uwsgi_pass 公网ip:8000;
include /etc/nginx/uwsgi_params;
client_max_body_size 10m;
}
location /static/ {
root /root/workfile/项目文件夹;
break;
}
client_body_timeout 3m;
send_timeout 3m;
proxy_send_timeout 3m;
}
server {
listen 80;
server_name ly.*;
#charset utf-8;
location / {
uwsgi_pass 公网ip:8001;
include /etc/nginx/uwsgi_params;
client_max_body_size 10m;
}
location /static/ {
root /root/workfile/GZ_WEB02;
break;
}
client_body_timeout 3m;
send_timeout 3m;
proxy_send_timeout 3m;
}
其中 server_name是关键 会根据域名的不同来判断主要有四种,我这里是第二种‘正则‘