From 0a60bfcb82580ecf7faa8a8a8ada33446fe3acad Mon Sep 17 00:00:00 2001 From: ILikePlayingGames <22475143+ILikePlayingGames@users.noreply.github.com> Date: Sun, 1 Sep 2024 05:47:39 -0400 Subject: [PATCH] Add Caddy and FrankenPHP Configurations to ExternalWebserversSQL.md (#90) * Update ExternalWebserversSQL.md Add examples for Caddy * Update wiki/webserver/ExternalWebserversSQL.md Co-authored-by: Wired Rose <78890450+CodingWithAnxiety@users.noreply.github.com> * Update wiki/webserver/ExternalWebserversSQL.md Co-authored-by: Wired Rose <78890450+CodingWithAnxiety@users.noreply.github.com> * Update config for FrankenPHP Co-authored-by: CodingWithAnxiety * Fix missing bracket in ExternalWebserversSQL.md * Update ExternalWebserversSQL.md * Remove caddy code-language (since it breaks wiki formatting unfortunately) * Update ExternalWebserversSQL.md --------- Co-authored-by: Wired Rose <78890450+CodingWithAnxiety@users.noreply.github.com> Co-authored-by: CodingWithAnxiety Co-authored-by: Lukas Rieger --- wiki/webserver/ExternalWebserversSQL.md | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/wiki/webserver/ExternalWebserversSQL.md b/wiki/webserver/ExternalWebserversSQL.md index 91efd35..655dcc2 100644 --- a/wiki/webserver/ExternalWebserversSQL.md +++ b/wiki/webserver/ExternalWebserversSQL.md @@ -101,3 +101,68 @@ ProxyPassMatch ^/(maps/[^/]*/live/.*) http://127.0.0.1:8100/$1 > **Important:**
> The above config is **just an example** and not a complete config you can just copy&paste. You **will** need to adapt it to your setup! {: .info .important } + +## Caddy with php-fpm + +Here is an example for how it could look like on Caddy with php-fpm: +``` +yourdomain.com { + # The root for the webserver. + root /var/www + file_server + + # https://caddyserver.com/docs/caddyfile/patterns#php-fpm + # You may need to modify this path. + php_fastcgi unix//run/php/php7.4-fpm.sock + + # Use the sql.php script, which handles requests with data from the sql-server. + handle { + try_files {path} /sql.php + } + + # OPTIONAL: + # Proxy requests for live data to the bluemaps integrated webserver. + # If you have multiple servers you will need to proxy each map-id to the correct server. + handle /maps/*/live/* { + reverse_proxy 127.0.0.1:8100 + } +} +``` +> **Important:**
+> The above config is **just an example** and not a complete config you can just copy&paste. You **will** need to adapt it to your setup! +{: .info .important } + +## FrankenPHP + +Here is an example for how it could look like on FrankenPHP: +``` +{ + # https://frankenphp.dev/docs/config/#caddyfile-config + # Enable FrankenPHP. + frankenphp +} + +yourdomain.com { + # The root for the webserver. + root /var/www + + # https://frankenphp.dev/docs/config/ + # Execute PHP files in the root directory and serve assets. + php_server + + # Use the sql.php script, which handles requests with data from the sql-server. + handle { + try_files {path} /sql.php + } + + # OPTIONAL: + # Proxy requests for live data to the bluemaps integrated webserver. + # If you have multiple servers you will need to proxy each map-id to the correct server. + handle /maps/*/live/* { + reverse_proxy 127.0.0.1:8100 + } +} +``` +> **Important:**
+> The above config is **just an example** and not a complete config you can just copy&paste. You **will** need to adapt it to your setup! +{: .info .important }