-
命令
start nginx :启动nginx nginx -s reload :修改配置后重新加载生效 nginx -s reopen :重新打开日志文件 nginx -t -c /path/to/nginx.conf :测试nginx配置文件是否正确 关闭nginx: nginx -s stop :快速停止nginx quit :完整有序的停止nginx
-
负载均衡
# weight 设置访问请求次数 upstream demo{ server 127.0.0.1:8080 weight=1; server 127.0.0.1:8081 weight=1; } server { listen 80; server_name localhost; location / { root html; index index.html; proxy_pass http://demo; } }
-
代理文件夹
server { listen 8089; server_name localhost; #本地映射的服务器地址 location / { root D:\\campusFile; } }
Nginx配置
最新推荐文章于 2024-05-20 16:10:07 发布