Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ http {
server {
root /var/www/html/Lychee/public;
listen 80;
listen [::]:80;
server_name localhost;
client_max_body_size 100M;

# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
index index.php;

location = /favicon.ico {
access_log off;
log_not_found off;
}
location = /robots.txt {
access_log off;
expires max;
log_not_found off;
}

Expand All @@ -65,35 +70,25 @@ http {
rewrite ^/(.+)/$ /$1 permanent;
}

# If the request is not for a valid file (image, js, css, etc.), send to bootstrap
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}

location / {
index index.php
try_files $uri $uri/ /index.php?$query_string;
}

# Serve /index.php through PHP
location = /index.php {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;

try_files $uri $document_root$fastcgi_script_name =404;
error_page 404 /index.php;

# Serve /index.php through PHP
location ~ ^/index\.php(/|$) {
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";

fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "post_max_size=100M
max_execution_time=3600
upload_max_filesize=100M
memory_limit=256M";
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
fastcgi_hide_header X-Powered-By;
include fastcgi_params;
}

Expand Down