|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: Reverse-Proxy on Coolify with Traefik |
| 4 | +parent: Community Guides |
| 5 | +nav_order: 9 |
| 6 | +--- |
| 7 | + |
| 8 | +# Reverse proxy BlueMap on Coolify with Traefik |
| 9 | + |
| 10 | +Here are some examples of how you can use Coolify + Traefik (Installed by default on Coolify) to reverse-proxy your BlueMap. |
| 11 | + |
| 12 | +This is useful if you want to integrate your map in your website and you're using Coolify, or want to add SSL-capabilities. |
| 13 | + |
| 14 | +## Assumptions / Prerequisites |
| 15 | +- You have already added an `A record` to your domain pointing to your `public IP`. |
| 16 | +- If you're planning on using a `subdomain`, you have already added an `A record` with your subdomain e.g. `bluemap` to your domain pointing to your `public IP`. |
| 17 | +- You have access to Coolify's dashboard (`public_address:8000`). |
| 18 | +- You already have a daemon server installed on Coolify (`public_address:8000/servers`). |
| 19 | +- BlueMaps integrated webserver is running on port `8100` and accessible on `public_address:8100` e.g. **if** your public_address is `200.121.121.100` then BlueMaps should be accessible from `200.121.121.100:8100`. *(If that is not the case you'll need to replace `8100` with the actual port below)* |
| 20 | + |
| 21 | +> **Warning:**<br> |
| 22 | +> Telling the internal-webserver to connect to one specific address like e.g. `127.0.0.1`, |
| 23 | +> <br>from `webserver.conf` by adding `ip: "127.0.0.1"` WILL GIVE A **BAD GATEWAY** ERROR. |
| 24 | +{: .info } |
| 25 | + |
| 26 | +## BlueMap on a subdomain |
| 27 | +- Go to `Coolify's Dashboard -> Servers -> YourServer -> Proxy -> Dynamic Configurations` |
| 28 | +- Press `+ Add`, give it a name like e.g. `bluemap.yaml` and make something like this: |
| 29 | + |
| 30 | +BlueMap on a subdomain e.g. `https://bluemap.example.com` (replace `public_address` with your `public IP`): |
| 31 | +```yaml |
| 32 | +http: |
| 33 | + routers: |
| 34 | + map-router: |
| 35 | + rule: Host(`bluemap.example.com`) |
| 36 | + entryPoints: |
| 37 | + - https |
| 38 | + service: bluemap |
| 39 | + tls: |
| 40 | + certResolver: letsencrypt |
| 41 | + services: |
| 42 | + bluemap: |
| 43 | + loadBalancer: |
| 44 | + servers: |
| 45 | + - url: 'http://public_address:8100' |
| 46 | +``` |
| 47 | +Press `Save` and `Reload`. |
| 48 | + |
| 49 | + |
| 50 | +## BlueMap on a subdirectory of your website |
| 51 | +- Go to `Coolify's Dashboard -> Servers -> YourServer -> Proxy -> Dynamic Configurations`. |
| 52 | +- Press `+ Add`, give it a name like e.g. `bluemap.yaml` and make something like this: |
| 53 | + |
| 54 | +BlueMap on a subdirectory e.g `https://www.example.com/bluemap` (replace `public_address` with your `public IP`): |
| 55 | +```yaml |
| 56 | +http: |
| 57 | + routers: |
| 58 | + bluemap: |
| 59 | + entryPoints: |
| 60 | + - https |
| 61 | + rule: "Host(`www.example.com`) && PathPrefix(`/bluemap/`)" |
| 62 | + service: "bluemap" |
| 63 | + tls: |
| 64 | + certResolver: letsencrypt |
| 65 | + middlewares: |
| 66 | + - "bluemapprefix" |
| 67 | + services: |
| 68 | + bluemap: |
| 69 | + loadBalancer: |
| 70 | + servers: |
| 71 | + - url: "http://public_address:8100" |
| 72 | + middlewares: |
| 73 | + bluemapprefix: |
| 74 | + stripprefix: |
| 75 | + prefixes: "/bluemap/" |
| 76 | +``` |
| 77 | +Press `Save` and `Reload`. |
| 78 | + |
| 79 | +> **Warning:**<br> |
| 80 | +> If you're using CloudFlare, make sure to add to your DNS an A record with your subdomain e.g. `bluemap` pointing to your public IP. |
| 81 | +{: .info } |
0 commit comments