Feedback

  • Contents
 

Example nginx Configuration

This topic contains an example for part of an nginx reverse proxy configuration. This example is meant only as an example and should not be used in production since it attempts to pass data directly to any server specified in wss://proxy/InternalServer/session and similar URIs. Use server name aliases combined with server mappings in the reverse proxy so as to not provide actual server names in the URIs.For more information, see Server Name Aliases.

map $1 $backend {

icserver 10.0.0.40;

ossm1 10.0.0.41;

ossm2 10.0.0.42;

}

location ~* ^/(.*)/session\/?$ {

if ($http_inin_client_type) {

proxy_pass http://$backend:8951/websocket-tunnel;

}

proxy_next_upstream error timeout http_502;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

}

location ~* ^/(.*)/http/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8018/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}

location ~* ^/(.*)/httpsecure/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8019/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}

location ~* ^/(.*)/recorder/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8106/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}

location ~* ^/(.*)/recordersecure/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8107/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}

location ~* ^/(.*)/dialer/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8121/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto$scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}

location ~* ^/(.*)/dialersecure/(.*) {

if ($http_inin_client_type) {

proxy_pass https://$backend:8122/$2;

}

proxy_set_headerX-Real-IP $remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_set_headerX-Forwarded-Proto $scheme;

proxy_set_headerHost$http_host;

proxy_redirectoff;

}