-
-
Notifications
You must be signed in to change notification settings - Fork 541
Using a reverse proxy
Julian Waller edited this page Sep 24, 2025
·
3 revisions
Sometimes it can be desirable to serve companion through a reverse proxy.
If you have an example for another reverse proxy, feel free to open a github issue to get it added here.
Generally, there is nothing special needed for this other than ensuring that websockets are handled, a complete nginx config is:
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
resolver 127.0.0.11;
}
In some circumstances, you may want to host it under a subpath instead of at the root of the domain.
As of Companion 4.1 this is now possible. It is not widely used, so it is possible that occasionally new features will forget to consider this use case. If you find an issue like this, open an issue and we will happily fix it
location /my-subpath-here/ {
proxy_set_header Companion-custom-prefix "my-subpath-here";
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
resolver 127.0.0.11;
}
Getting Started
- Home
- Installation
- Getting Started Beginners Guide
- Companion on the Raspberry Pi
- Using a reverse proxy
- Build for Another Device (Distributable Linux Build)
- X Keys support
- How to use a module that is not included in Companion build
Development
- Setting up Developer Environment
- How to move to a fork after cloning
- Module Development for 3.0
- Satellite API
- Versioning
More Information
Maintainer Docs