Page 1 of 1

Creating a custom URL for private network

PostPosted: Mon Mar 02, 2015 5:16 pm
by orav
Hi, I've managed to activate subsonic and the users are currently connecting to it via the computer name and port ("orav-pc:4040/" to be exact) but i want to create a much simpler URL like "music/" within the network.
The network is isolated from the internet.
Help anyone? :)

Re: Creating a custom URL for private network

PostPosted: Wed Mar 04, 2015 9:04 pm
by plastikman
I have not tested this but it should work.

Create a dns name on the network that points music to the host that is running nginx

use nginx to create a reverse proxy

Code: Select all
upstream subsonic_backend {
    server orav-pc:4040;

    keepalive 600;
}
server {
  listen                *:80 ;

  server_name           proxy;
  access_log            /var/log/nginx/proxy.access.log;

location / {
        proxy_pass http://subsonic_backend$request_uri;
        proxy_read_timeout 90;
        proxy_http_version 1.1;
        proxy_set_header Connection "Keep-Alive";
        proxy_set_header Proxy-Connection "Keep-Alive";
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}