nginx+nacos集群配置模版

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;
	
	upstream nacoscluster {
		server 127.0.0.1:10003;
		server 127.0.0.1:10006;
		server 127.0.0.1:10009;
	}

    server {
	    //http端口
        listen       80;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
			proxy_pass http://nacoscluster;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

# nacos2.x使用grpc调用,TCP代理转发
stream {
	upstream nacoscluster {
		server 127.0.0.1:11003;
		server 127.0.0.1:11006;
		server 127.0.0.1:11009;
	}
	server {
		# http端口+1000
		listen 1080;
		proxy_pass nacoscluster;  
	}
}

你可能感兴趣的:(SpringCloud,nginx,nginx,运维)