nginx.conf 配置内容:
#-------------------------------------------------
#需要两个tomcat 能同时运行,配置不同的端口。
#-----------------------------------------------------
worker_processes 2;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
#gzip on;
upstream myenginx {
server localhost:8080;
server localhost:8083;
}
server {
listen 80;
server_name localhost;
charset UTF-8;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
proxy_pass http://myenginx; #请求转向mysvr 定义的服务器列表
}
}
}
本文详细解读了NGINX配置文件,着重介绍了如何通过配置实现两个不同端口的Tomcat服务器同时运行,确保了负载均衡与高效资源利用。
7万+

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



