本文讲解最简单的Nginx配置方法,双Tomcat负载,
Nginx配置文件内容 nginx\conf\nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name tomcat1;
location / {
proxy_pass http://192.168.1.1;
}
}
server {
listen 80;
server_name tomcat2;
location / {
proxy_pass http://192.168.1.2;
}
}
}