From f03352e572e3eebc03ce5e3480bf3e4153edb54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B8ller?= Date: Sat, 26 Apr 2025 17:21:47 +0200 Subject: [PATCH 1/3] Add a Caddy guide Basically a copy of the Nginx one, just for Caddy. Well tested as i use this setup myself --- wiki/webserver/CaddyProxy.md | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 wiki/webserver/CaddyProxy.md diff --git a/wiki/webserver/CaddyProxy.md b/wiki/webserver/CaddyProxy.md new file mode 100644 index 0000000..4b4a405 --- /dev/null +++ b/wiki/webserver/CaddyProxy.md @@ -0,0 +1,37 @@ +--- +layout: page +title: Reverse-Proxy with Caddy +parent: Webserver +grand_parent: Wiki +nav_order: 4 +--- + +# Reverse proxy BlueMap with Caddy + +Here are some examples how you can use Caddy to reverse-proxy your BlueMap. + +This is useful if you want to integrate your map in your website, or want to add SSL-capabilities. + +## Assumptions / Prerequisites +- You have access to your servers shell (not only the minecraft-console). +- You have Caddy already + [installed](https://caddyserver.com/docs/install). +- Caddy is running on the same machine as BlueMaps integrated webserver. *(If that is not the case you'll need to + replace `localhost` with the correct ip in the examples below)* +- BlueMaps integrated webserver is running on port `8100`. *(Again, just replace `8100` with the actual port below)* + +> **Info:**
+> If you want, you can tell the internal-webserver to only connect to one specific address like e.g. `127.0.0.1`, +> so it is no longer accessible from the outside (by default it just connects to all available interfaces): +> To do this, just open the `webserver.conf` and add the `ip: "127.0.0.1"` setting somewhere. +{: .info } + + +## BlueMap on a subdomain +If you want BlueMap on a subdomain e.g. `https://map.mydomain.com/` then you'd add something like this to +your Caddyfile: +```caddy +map.mydomain.com { + reverse_proxy 127.0.0.1:8100 +} +``` From 0b170707b98effbfc5f2c1d5af95395cdbee59c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B8ller?= Date: Sat, 26 Apr 2025 17:34:31 +0200 Subject: [PATCH 2/3] Update CaddyProxy.md --- wiki/webserver/CaddyProxy.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wiki/webserver/CaddyProxy.md b/wiki/webserver/CaddyProxy.md index 4b4a405..c2543b3 100644 --- a/wiki/webserver/CaddyProxy.md +++ b/wiki/webserver/CaddyProxy.md @@ -26,6 +26,16 @@ This is useful if you want to integrate your map in your website, or want to add > To do this, just open the `webserver.conf` and add the `ip: "127.0.0.1"` setting somewhere. {: .info } +## BlueMap on a subdirectory of your website +If you have a normal website hosted with Caddy and want your map on `/map` (e.g `https://mydomain.com/map`) then +you can add this to your Caddyfile: +```caddy +mydomain.com { + handle_path /map/* { + reverse_proxy 127.0.0.1:8100 + } +} +``` ## BlueMap on a subdomain If you want BlueMap on a subdomain e.g. `https://map.mydomain.com/` then you'd add something like this to From c3ef50edc6eac44b676499652fb8971f5f4c9f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B8ller?= Date: Tue, 29 Apr 2025 09:14:04 +0200 Subject: [PATCH 3/3] Merged caddy into the nginx page --- wiki/webserver/CaddyProxy.md | 47 --------------------------------- wiki/webserver/NginxProxy.md | 50 +++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 59 deletions(-) delete mode 100644 wiki/webserver/CaddyProxy.md diff --git a/wiki/webserver/CaddyProxy.md b/wiki/webserver/CaddyProxy.md deleted file mode 100644 index c2543b3..0000000 --- a/wiki/webserver/CaddyProxy.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: page -title: Reverse-Proxy with Caddy -parent: Webserver -grand_parent: Wiki -nav_order: 4 ---- - -# Reverse proxy BlueMap with Caddy - -Here are some examples how you can use Caddy to reverse-proxy your BlueMap. - -This is useful if you want to integrate your map in your website, or want to add SSL-capabilities. - -## Assumptions / Prerequisites -- You have access to your servers shell (not only the minecraft-console). -- You have Caddy already - [installed](https://caddyserver.com/docs/install). -- Caddy is running on the same machine as BlueMaps integrated webserver. *(If that is not the case you'll need to - replace `localhost` with the correct ip in the examples below)* -- BlueMaps integrated webserver is running on port `8100`. *(Again, just replace `8100` with the actual port below)* - -> **Info:**
-> If you want, you can tell the internal-webserver to only connect to one specific address like e.g. `127.0.0.1`, -> so it is no longer accessible from the outside (by default it just connects to all available interfaces): -> To do this, just open the `webserver.conf` and add the `ip: "127.0.0.1"` setting somewhere. -{: .info } - -## BlueMap on a subdirectory of your website -If you have a normal website hosted with Caddy and want your map on `/map` (e.g `https://mydomain.com/map`) then -you can add this to your Caddyfile: -```caddy -mydomain.com { - handle_path /map/* { - reverse_proxy 127.0.0.1:8100 - } -} -``` - -## BlueMap on a subdomain -If you want BlueMap on a subdomain e.g. `https://map.mydomain.com/` then you'd add something like this to -your Caddyfile: -```caddy -map.mydomain.com { - reverse_proxy 127.0.0.1:8100 -} -``` diff --git a/wiki/webserver/NginxProxy.md b/wiki/webserver/NginxProxy.md index 2fd2c58..af0a312 100644 --- a/wiki/webserver/NginxProxy.md +++ b/wiki/webserver/NginxProxy.md @@ -1,37 +1,39 @@ --- layout: page -title: Reverse-Proxy with NGINX +title: Reverse-Proxy with NGINX or Caddy parent: Webserver grand_parent: Wiki nav_order: 3 --- -# Reverse proxy BlueMap with NGINX +# Reverse proxy BlueMap with NGINX or Caddy -Here are some examples how you can use NGINX to reverse-proxy your BlueMap. +Here are some examples how you can use NGINX or Caddy to reverse-proxy your BlueMap. This is useful if you want to integrate your map in your website, or want to add SSL-capabilities. ## Assumptions / Prerequisites - You have access to your servers shell (not only the minecraft-console). -- You have NGINX already - [installed](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/). -- NGINX is running on the same machine as BlueMaps integrated webserver. *(If that is not the case you'll need to +- You have [NGINX](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/) or [Caddy](https://caddyserver.com/docs/install) already + installed. +- NGINX or Caddy is running on the same machine as BlueMaps integrated webserver. *(If that is not the case you'll need to replace `localhost` with the correct ip in the examples below)* - BlueMaps integrated webserver is running on port `8100`. *(Again, just replace `8100` with the actual port below)* > **Info:**
> If you want, you can tell the internal-webserver to only connect to one specific address like e.g. `127.0.0.1`, -> so it is no longer accessible from the outside (by default it just connects to all available interfaces): +> so it is no longer accessible from the outside (by default it just connects to all available interfaces): > To do this, just open the `webserver.conf` and add the `ip: "127.0.0.1"` setting somewhere. {: .info } ## BlueMap on a subdirectory of your website -If you have a normal website hosted with NGINX and want your map on `/map` (e.g `https://mydomain.com/map`) then -you can just add this to your NGINX configuration: +If you have a normal website hosted with NGINX or Caddy and want your map on `/map` (e.g `https://mydomain.com/map`) + +### NGINX +You can add the following to your NGINX config. ```nginx server { - + ... location /map/ { @@ -40,9 +42,24 @@ server { } ``` +### Caddy + +You can add the following to your Caddyfile. + +```caddy +mydomain.com { + handle_path /map/* { + reverse_proxy 127.0.0.1:8100 + } +} +``` + ## BlueMap on a subdomain -If you want BlueMap on a subdomain e.g. `https://map.mydomain.com/` then you'd add something like this to -your nginx config: +If you want BlueMap on a subdomain e.g. `https://map.mydomain.com/` + +### NGINX +On NGINX you can add this to your config. + ```nginx server { listen 80; @@ -55,3 +72,12 @@ server { } } ``` + +### Caddy +You can add the following to your Caddyfile. + +```caddy +map.mydomain.com { + reverse_proxy 127.0.0.1:8100 +} +```