Nginx+Tomcat

1:

Tomcat:

<Engine name="Catalina" defaultHost="localhost">
<Host name="solr.fangtoon.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
             <Context path="" docBase="C:/Programs/Env/Tomcat/solr" reloadable="false" caseSensitive="false" debug="0"></Context>
             <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="tomcat" suffix=".txt" pattern="common" resolveHosts="false"/>
       </Host>
</Engine>

 2:

Nginx:

单台:

server {
        listen       80;
        server_name  solr.fangtoon.com;

        location / {
			root html;
            proxy_pass http://127.0.0.1:8080;
			proxy_set_header   Host    $host; 
			proxy_set_header   X-Real-IP   $remote_addr; 
			proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
        }
    }

 

多台:

upstream cluster_severs {
		server 127.0.0.1:8080 weight=5;
		server 172.28.5.33:8080;
		server 172.28.5.33:8080 backup;
	}
	
	
	server {
        listen       80;
        server_name  solr.fangtoon.com;

        location / {
	    proxy_cache_bypass $arg_nocache;
        proxy_pass http://cluster_severs;
		proxy_set_header   Host    $host; 
		proxy_set_header   X-Real-IP   $remote_addr; 
		proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for; 
        }
    }

 

你可能感兴趣的:(tomcat)