events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name www.xxx.com xxx.com ;
location / {
root /home/project/xxx;
index index.html;
}
}
server {
listen 80;
server_name www.xxx2.plus xxx2.plus;
location / {
root /home/project/xxx2;
index index.html;
}
}
server {
listen 80;
server_name xxxx;
location / {
include mime.types;
default_type application/octet-stream;
root /home/web;
index index.html;
}
location /admin {
proxy_pass http://127.0.0.1:8080;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
nginx -t 查看配置文件地址
nginx -s reload 重启
./nginx 启动 (在nginx的sbin目录下 whereis nginx 查看路径)
killall nginx 停止nginx