http服务器,可以做网页静态化文件(如页面静态化)
反向代理,负载均衡,能够实现高并发
虚拟主机,可以配置多个服务地址
server {
listen 80; # 监听的端口
server_name localhost; # 域名或ip
location / { # 访问路径配置
root index;# 根目录
index index.html index.htm; # 默认首页
}
配置反向代理
upstream tomcat-travel{
server 192.168.177.129:8080;
}
server {
listen 80; # 监听的端口
server_name www.hmtravel.com; # 域名或ip
location / { # 访问路径配置
# root index;# 根目录
proxy_pass http://tomcat-travel; #代理的服务
index index.html index.htm; # 默认首页
}
}
负载均衡