反向代理
server { listen 9001; server_name 192.168.88.128; location ~ /edu/ { proxy_pass http://127.0.0.1:8080; } location ~ /vod/ { proxy_pass http://127.0.0.1:8081; } }
负载均衡
upstream myserver { server 192.168.17.129:8080; server 192.168.17.129:8081;}
server { listen 80; server_name 192.168.88.128; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://myserver; root html; index index.html index.htm; } }
动静分离**
location /www/ { root /data/; index index.html index.htm;}location /image/ { root /data/; # 会列出所有文件 autoindex on;}