ngnix 使用1--反向代理1

window 版:

下载: https://nginx.org/en/download.html

 

解压:

ngnix 使用1--反向代理1_第1张图片

 

 

 

 

配置:

#user nobody;
worker_processes 1;

events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;


sendfile on;

keepalive_timeout 65;

##### 反向代理 ##### 
upstream tomcat1 {
server 192.168.18.155:7016;
}

server {
listen 80;
server_name localhost;

location / {
proxy_pass http://tomcat1;
index index.html index.htm;
}
}


upstream tomcat2 {
server 192.168.25.148:8081;
}
server {
listen 80;
server_name www.sea.com;

location / {
proxy_pass http://tomcat2;
index index.html index.htm;
}
}






}

 

你可能感兴趣的:(ngnix 使用1--反向代理1)