Xibo reverse proxy + NAT + custom port

Hi all,

We are deploying a somthing special installation CMS (docker) + Android players with reverse proxy using Nginx.

The problem is that players can connect to CMS but can not download any files.

I think the problem could be when NAT-ing to Internet NGINX because we can not use standard ports (80 or 443 for SSL). We need to use another port and a path like:

https://domain.com:9443/somepath/ but before the proxy the CMS direction is http://192.XXX.XXX.XXX/ (docker container)

It is necesary to adjust some configuration file o something else to customize the external URL that is used by players at the Internet side?

The XMR is working fine behind reverse tcp proxy using the standard port 9505.

Thanks in advance

Hi!

You’d need to make sure your proxy passed the host/server and for headers, something like:

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://192.xxx.xxx.xxx;
    }

Xibo parses HTTP_HOST to get the original host/port for outputting file URLs :slight_smile:

Hi Dan! Just done it, but still not working. This is my nginx conf:

image

The problem is that path arriving player has the internal IP. Look at this RequiredFilesXml response obtained with SoapUI:

image

Any idea? It is possible to force this path with the external URL?

Thanks

You need to handle that in nginx - so that when the request gets to the docker container it has the correct host headers (that is the purpose of the config I sent, although perhaps its not quite right)

In Apache it is ProxyPreserveHost On - i’m not sure what the nginx equivilant is, but I am sure you’d be able to find out from somewhere.

Hi Dan, maybe it’s not the best solution but after trying with lot of set_header configs I’ve solved it with sub_filters module of NGINX:

imagen

It’s working fine and players begin downloading files!

Thanks

1 Like

You just need to pass the host header through like this:

location /some/path/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Port  $server_port;
    proxy_pass http://192.168.1.1:8080;
}

Ah man! I was so close!

Thanks Alex

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.