From 91efe9a465df0a6647fbb0f7c5643be89cdcc7e1 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 5 May 2025 00:46:17 +0500 Subject: feat: custom static --- .gitignore | 3 ++- README.md | 5 +++++ public/404.php | 2 +- src/config.sample.php | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c6d12f5..665c2a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.vscode userdata/ *.db -config.php \ No newline at end of file +config.php +custom_static/ \ No newline at end of file diff --git a/README.md b/README.md index a81ae18..6128375 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,11 @@ server { root /www/tinyemotesinstance/public; index index.php; + location ~ ^/static/?(.*)$ { + root /www/tinyemotesinstance/public; + try_files /custom_static/$1 /static/$1 =404; + } + location / { try_files $uri $uri/ /index.php?$query_string; } diff --git a/public/404.php b/public/404.php index 58aa7db..cd7e12e 100644 --- a/public/404.php +++ b/public/404.php @@ -31,7 +31,7 @@ $reason = str_safe($_GET["error_reason"] ?? "Not found", 200);
" alt=""> diff --git a/src/config.sample.php b/src/config.sample.php index 5962a20..f1c3a45 100644 --- a/src/config.sample.php +++ b/src/config.sample.php @@ -1,6 +1,7 @@