【Nginx那些事】系列
【Nginx那些事】nginx 安装及常用指令
【Nginx那些事】Nginx 配置文件说明
【Nginx那些事】nginx原理解析
【Nginx那些事】nginx配置实例(一)反向代理
【Nginx那些事】nginx配置实例(二)负载均衡
【Nginx那些事】nginx配置实例(三)动静分离
【Nginx那些事】nginx配置实例(四)搭建高可用集群
实例一
代理 8023.com 到 192.168.227.3:8082/demo
server {
listen 80;
server_name 8023.com;
location / {
proxy_pass http://192.168.227.3:8082/demo/;
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
实例二
代理 8023.com/8082 到 192.168.227.3:8082/demo
代理8023.com/8081到 192.168.227.3:8081
server {
listen 80;
server_name 8023.com;
location /8082 {
proxy_pass http://192.168.227.3:8082/demo/;
root html;
index index.html index.htm;
}
location /8081 {
proxy_pass http://192.168.227.3:8081/;
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}