From 87ffaa00ae562774a7a267f30fa3d0cdac274e91 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 4 Mar 2026 19:54:36 +0200 Subject: [PATCH] add nginx example --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index c19cd6a..9726916 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,45 @@ Project initially written to explore [Yggdrasil](https://github.com/yggdrasil-ne * `cp .env .env.local` * `crontab -e` > `* * * * * /usr/bin/curl --silent http://localhost/crontab/index &> /dev/null` +#### Nginx + +``` +map $request_uri $loggable { + ~^/crontab/index 0; + default 1; +} + +server { + listen [::]:27080; + + server_name hl.ygg ygg.hl.srv; + + access_log /var/log/nginx/hl.access.log combined if=$loggable; + error_log /var/log/nginx/hl.error.log warn; + + root /var/www/hlstate/HLState/public; + + index index.php index.html; + + location / { + try_files $uri /index.php$is_args$args; + } + location ~ ^/index\.php(/|$) { + fastcgi_pass unix:/run/php/php8.4-fpm.sock; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + + fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; + fastcgi_param DOCUMENT_ROOT $realpath_root; + + internal; + } + location ~ \.php$ { + return 404; + } +} +``` + ### Update * `git pull`