-
Notifications
You must be signed in to change notification settings - Fork 19
Setting up HTTPS for a BrightID Node
Adam Stallard edited this page Dec 2, 2022
·
11 revisions
There are various ways to set up an SSL reverse proxy in front of a BrightID Node. One way is to use nginx and certbot.
- Get a domain name (sub-domains work). (This example uses
aura-node.brightid.org
).- Configure the DNS to point the domain or sub-domain to your node's ip address.
- Change the port for BrightID node docker to use port 8080 (so our reverse proxy can use port 80 as certbot expects).
- Edit
~/BrightID-Node-docker/web/brightid-nginx.conf
to replace the existinglisten
directive with
listen 127.0.0.1:8080;
cd ~/BrightID-Node-docker/
-
docker-compose restart web
to pick up the changes -
docker ps -a
to ensure thatnginx
restarted successfully.
- Edit
- Install
nginx
certbot
andpython3-certbot-nginx
sudo apt-get install nginx certbot python3-certbot-nginx
- Configure your reverse proxy. Here is an example nginx configuration.
server {
server_name aura-node.brightid.org;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Origin * always;
}
}
- Then restart nginx (e.g.
systemctl restart nginx
)
- Run certbot
sudo certbot --nginx -d aura-node.brightid.org
See also this guide from nginx and certbot.