Reverse Proxy
This guide will help you set up a reverse proxy for the application. A reverse proxy is a server that sits in front of your application and forwards client requests to it.
Traefik
Section titled “Traefik”-
Create a new docker network for e.g.
proxy
:Terminal window docker network create proxy -
Adjust your
docker-compose.yml
file to include the Traefik service:services:traefik:image: traefik:latestcontainer_name: traefikports:- "80:80"- "8080:8080" # Traefik dashboardnetworks:- proxyvolumes:- "/var/run/docker.sock:/var/run/docker.sock"slink:image: anirdev/slink:latestcontainer_name: slinkrestart: alwaysenvironment:- ORIGIN=https://your-domain.comvolumes:- ./data/slink/var/data:/app/var/data- ./data/slink/images:/app/slink/imageslabels:- "traefik.enable=true"- "traefik.http.routers.slink.entrypoints=http"- "traefik.http.routers.slink.rule=Host(`your-domain.com`)"- "traefik.http.middlewares.slink-https-redirect.redirectscheme.scheme=https"- "traefik.http.routers.slink.middlewares=slink-https-redirect"- "traefik.http.routers.slink-secure.entrypoints=https"- "traefik.http.routers.slink-secure.rule=Host(`your-domain.com`)"- "traefik.http.routers.slink-secure.tls=true"- "traefik.http.routers.slink-secure.service=slink"- "traefik.http.services.slink.loadbalancer.server.port=3000"- "traefik.docker.network=proxy"networks:- proxynetworks:proxy:external: true -
Restart your Docker containers.
-
Open your browser and navigate to
http://your-domain.com
to access the Slink application.
Nginx Proxy Manager
Section titled “Nginx Proxy Manager”-
Create a new docker network for e.g.
proxy
:Terminal window docker network create proxy -
Adjust your
docker-compose.yml
file to include the Nginx Proxy Manager service:services:nginx-proxy-manager:image: jc21/nginx-proxy-manager:latestcontainer_name: nginx-proxy-managerrestart: alwaysports:- "80:80"- "81:81"networks:- proxyslink:image: anirdev/slink:latestcontainer_name: slinkrestart: alwaysenvironment:- ORIGIN=https://your-domain.comvolumes:- ./data/slink/var/data:/app/var/data- ./data/slink/images:/app/slink/imagesnetworks:- proxynetworks:proxy:external: true -
Restart your Docker containers.
-
Open your browser and navigate to
http://your-domain.com:81
to access the Nginx Proxy Manager dashboard. -
Create a new proxy host with the following settings:
- Domain Names:
your-domain.com
- Scheme:
http
- Forward Hostname / IP:
slink
- Forward Port:
3000
- Block Common Exploits:
true
- Websockets Support:
true
- SSL:
Request a new SSL certificate
- Force SSL:
true
- Domain Names:
-
Click on the
Save
button to create the proxy host. -
Open your browser and navigate to
https://your-domain.com
to access the Slink application.