diff --git a/default.conf b/default.conf index bb81ba8..ea853a1 100644 --- a/default.conf +++ b/default.conf @@ -24,60 +24,61 @@ http { gzip on; server { - root /var/www/html/Lychee-Laravel/public; + root /var/www/html/Lychee-Laravel/public; listen 80; server_name localhost; client_max_body_size 100M; # serve static files directly - location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { - access_log off; - expires max; - log_not_found off; - } - - # removes trailing slashes (prevents SEO duplicate content issues) - if (!-d $request_filename) - { - rewrite ^/(.+)/$ /$1 permanent; - } - - # enforce NO www - if ($host ~* ^www\.(.*)) - { - set $host_without_www $1; - rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; - } - - # unless the request is 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; - } - - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - - try_files $uri $document_root$fastcgi_script_name =404; - - # Mitigate https://httpoxy.org/ vulnerabilities - fastcgi_param HTTP_PROXY ""; - - fastcgi_pass unix:/run/php/php7.3-fpm.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PHP_VALUE "post_max_size=100M - max_execution_time=200 - upload_max_size=100M - upload_max_filesize=20M - memory_limit=256M"; - include fastcgi_params; - } - } + location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { + access_log off; + expires max; + log_not_found off; + } + + # removes trailing slashes (prevents SEO duplicate content issues) + if (!-d $request_filename) + { + rewrite ^/(.+)/$ /$1 permanent; + } + + # enforce NO www + if ($host ~* ^www\.(.*)) + { + set $host_without_www $1; + rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent; + } + + # unless the request is 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; + } + + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + + try_files $uri $document_root$fastcgi_script_name =404; + + # Mitigate https://httpoxy.org/ vulnerabilities + fastcgi_param HTTP_PROXY ""; + + fastcgi_pass unix:/run/php/php7.3-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PHP_VALUE "post_max_size=100M + max_execution_time=200 + upload_max_size=100M + upload_max_filesize=20M + memory_limit=256M"; + fastcgi_param PATH /usr/local/bin:/usr/bin:/bin; + include fastcgi_params; + } + } }