nginx配置非80端口

#user  nobody;
worker_processes  2;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    upstream myServer{
	    ip_hash;
		server 192.168.16.146:8066;
		server 192.168.16.146:8070;
      }

	server {
		listen 8000;
		location / {
			proxy_set_header Host $host:$server_port;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header REMOTE-HOST $remote_addr;
			proxy_redirect off;
			# proxy_set_header  X-Forwarded-Proto  $scheme;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			
			proxy_pass http://myServer;
		}
	  }

}

 

你可能感兴趣的:(java)