启动、关闭、重启
./nginx 启动命令
./nginx -s stop 关闭命令
./nginx -s reload 重新加载配置nginx.conf文件,使用该命令可以在nginx.conf文件改动的时候不需要重新启动nginx即可生效
nginx.conf文件简单配置
#待选服务器列表
upstream testHost{
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:8081 weight=1;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
#
location / {
#选择哪个服务器列表
proxy_pass http://testHost;
#proxy_pass http://127.0.0.1:8082;
}
location /ceshi/ {
proxy_pass http://127.0.0.1:8082/;
}
location /xixi/ {
proxy_pass http://127.0.0.1:8083/;
}
网友评论