Nginx配置单主机多域名

时间:2023-03-09 15:56:46
Nginx配置单主机多域名
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    upstream www.aaa.com {
			server 124.205.16.69:8090;
    }  

    upstream www.bbb.com {
			server 124.205.16.69:8100;
    }

    server {
        listen       80;
        server_name  www.aaa.com;

        location / {
            index  index.html index.jsp;
            proxy_pass  http://www.aaa.com;
            proxy_set_header    X-Real-IP   $remote_addr;
            client_max_body_size    100m;
        }

    }

    server {
        listen       80;
        server_name www.bbb.com;

        location / {
            index  index.html index.jsp;
            proxy_pass  http://www.bbb.com;
            proxy_set_header    X-Real-IP   $remote_addr;
            client_max_body_size    100m;
        }
    }
}