天天看点

nginx,tomcat配置

找到nginx下的主配置

nginx,tomcat配置

添加配置目录

nginx,tomcat配置

添加配置文件

nginx,tomcat配置

负载均衡一下

nginx,tomcat配置
nginx,tomcat配置

负载均衡 weight配置权重

upstream www.juzhi.com{
	server www.juzhi.com:8080 weight=1;
	server www.juzhi.com:9080 weight=1;
	#server 127.0.0.1:8080;
	#server 127.0.0.1:9080;
}

server {
    listen 80;
    autoindex on;
    server_name www.juzhi.com;
    access_log c:/access.log combined;
    index index.html index.htm index.jsp index.php;
    #error_page 404 /404.html;
    if ( $query_string ~* ".*[\;'\<\>].*" ){
        return 404;
    }
    location / {
        proxy_pass http://www.juzhi.com;
        add_header Access-Control-Allow-Origin *;
    }
}
           

继续阅读