diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | public/404.php | 2 | ||||
| -rw-r--r-- | src/config.sample.php | 1 |
4 files changed, 9 insertions, 2 deletions
@@ -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 @@ -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); <section style="position: absolute; right: 6px; bottom: 6px;"> <img src="/static/img/404/<?php - $files = scandir("static/img/404"); + $files = scandir(INSTANCE_STATIC_FOLDER . "/img/404"); array_splice($files, 0, 2); echo $files[random_int(0, count($files) - 1)]; ?>" alt=""></img> 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 @@ <?php // INSTANCE define("INSTANCE_NAME", "TinyEmotes"); +define("INSTANCE_STATIC_FOLDER", "static"); // Static folder. Used only in /404.php. // DATABASE define("DB_USER", "ENTER_DATABASE_USER"); // Database user. MANDATORY! |
