直接放 nginx.conf 文件吧。 差不多直接看配置文件就能懂如何去配置,具体还是得细说一下。
#叮叮货滴-管理后台
server {
listen 80;
server_name admin.ceshi.com;
location / {
index index.html index.htm;
proxy_pass http://110.120.130.140:8888;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#叮叮货滴-shipper
server {
listen 80;
server_name shipper.ceshi.com;
location / {
index index.html index.htm;
proxy_pass http://110.120.130.140:7777;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#叮叮货滴-app
server {
listen 80;
server_name app.ceshi.com;
location / {
index index.html index.htm;
proxy_pass http://110.120.130.140:9999;
}
error_page 500 502 503 504 /50x

本文介绍了如何使用Nginx在同一域名下部署多个项目,例如门户管理、货主管理、司机管理和app管理,这些项目分别在四个不同的Tomcat实例上运行。首先确保每个Tomcat应用能单独通过IP和端口访问,然后在Nginx的配置文件(nginx.conf)中添加server块。强调了`server_name`字段应设置为已解析的域名,因为没有域名解析,将无法访问。文章会详细解析`server`配置及其意义。
最低0.47元/天 解锁文章
3133

被折叠的 条评论
为什么被折叠?



