Skip to content

Proxying Groove Basin via nginx

Andrew Kelley edited this page Aug 17, 2015 · 1 revision

This might be useful, for example, if you have multiple domains, only one of which is Groove Basin, and you want one server to operate both of them. For example, demo.groovebasin.com is running on the same server as a bunch of other stuff. Here's the nginx config for it. This goes in /etc/nginx/sites-enabled/default:

server {
        listen 80;

        server_name demo.groovebasin.com;

        location / {
                proxy_pass http://127.0.0.1:16242;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

server {
        listen 80;

        server_name example.andrewkelley.me;

        location / {
                proxy_pass http://127.0.0.1:13370;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

The first block is what you want. Groove Basin is running with host set to 127.0.0.1 and port set to 16242 (the default). The proxy options are there so that websockets and uploads work normally. The second block demonstrates running another server on the same computer with a different domain name.

Clone this wiki locally