1.nginx安装请参考:http://www.runoob.com/linux/nginx-install-setup.html
2.nginx虚拟主机的配置
server {
listen 80;#server_name domain name;
#charset koi8-r;
#set intercept file type if file type equals gif,jpg,js.. Jump to /data/upload/static/;
location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|css|eot|svg|ttf|woff|otf|js)$ {
root /data/upload/static/;
try_files $uri @www;
}
#because i use vue so i hope jump to www Catalog
#if you do not use vue ,In accordance with the actual situation
location / {
root /www/;
index index.html index.htm;
}
location @www {
root /www/;
}
location /aaa/ {
proxy_pass http://ip:port/aaa/;
proxy_redirect default ;
}
location /bbb/ {
proxy_pass http://ip:port/bbb/;
proxy_redirect default ;
}
location /ccc/ {
proxy_pass http://ip:port/ccc/;
proxy_redirect default ;
}
}