天天看點

nginxstream根據域名轉發

求一段nginx的配置。要求根據不同的來路域名,發送到不同的端口去處理。

多加一個虛拟機就行了```一個8088``一個8080upstream wwwserver xxx.xxx.xxx.xxx:8088 max_fails=3 fail_timeout=30s;upstream bbs{server xxx.xxx.xxx.xxx:8080 max_fails=3 fail_timeout=30s;}server {listen80;server_namewww.abc.com;location / {index index.html index.php index.jsp index.htm;;proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;#proxy_connect_timeout 90;#proxy_send_timeout 90;#proxy_read_timeout 90;#proxy_buffers 32 4K;log_format'$remote_addr - $remote_user [$time_local] $request ''"$status" $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"''"$server_addr;" "$upstream_addr "';server {listen80;server_namebbs.abc.com ;location / {indexindex.html index.php index.jsp index.htm;;proxy_redirectoff;proxy_set_headerHost$host;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;#proxy_connect_timeout 90;#proxy_send_timeout90;#proxy_read_timeout90;#proxy_buffers32 4K;}}}#end of http      

怎麼用nginx實作域名轉發或用wdcp實作域名轉發