@@ -24,60 +24,61 @@ http {
2424 gzip on;
2525
2626 server {
27- root /var/www/html/Lychee-Laravel/public;
27+ root /var/www/html/Lychee-Laravel/public;
2828 listen 80;
2929 server_name localhost;
3030 client_max_body_size 100M;
3131
3232 # serve static files directly
33- location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
34- access_log off;
35- expires max;
36- log_not_found off;
37- }
38-
39- # removes trailing slashes (prevents SEO duplicate content issues)
40- if (!-d $request_filename)
41- {
42- rewrite ^/(.+)/$ /$1 permanent;
43- }
44-
45- # enforce NO www
46- if ($host ~* ^www\.(.*))
47- {
48- set $host_without_www $1;
49- rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
50- }
51-
52- # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
53- if (!-e $request_filename)
54- {
55- rewrite ^/(.*)$ /index.php?/$1 last;
56- break;
57- }
58-
59- location / {
60- index index.php
61- try_files $uri $uri/ /index.php?$query_string;
62- }
63-
64- location ~ [^/]\.php(/|$) {
65- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
66-
67- try_files $uri $document_root$fastcgi_script_name =404;
68-
69- # Mitigate https://httpoxy.org/ vulnerabilities
70- fastcgi_param HTTP_PROXY "";
71-
72- fastcgi_pass unix:/run/php/php7.3-fpm.sock;
73- fastcgi_index index.php;
74- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
75- fastcgi_param PHP_VALUE "post_max_size=100M
76- max_execution_time=200
77- upload_max_size=100M
78- upload_max_filesize=20M
79- memory_limit=256M";
80- include fastcgi_params;
81- }
82- }
33+ location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
34+ access_log off;
35+ expires max;
36+ log_not_found off;
37+ }
38+
39+ # removes trailing slashes (prevents SEO duplicate content issues)
40+ if (!-d $request_filename)
41+ {
42+ rewrite ^/(.+)/$ /$1 permanent;
43+ }
44+
45+ # enforce NO www
46+ if ($host ~* ^www\.(.*))
47+ {
48+ set $host_without_www $1;
49+ rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
50+ }
51+
52+ # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
53+ if (!-e $request_filename)
54+ {
55+ rewrite ^/(.*)$ /index.php?/$1 last;
56+ break;
57+ }
58+
59+ location / {
60+ index index.php
61+ try_files $uri $uri/ /index.php?$query_string;
62+ }
63+
64+ location ~ [^/]\.php(/|$) {
65+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
66+
67+ try_files $uri $document_root$fastcgi_script_name =404;
68+
69+ # Mitigate https://httpoxy.org/ vulnerabilities
70+ fastcgi_param HTTP_PROXY "";
71+
72+ fastcgi_pass unix:/run/php/php7.3-fpm.sock;
73+ fastcgi_index index.php;
74+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
75+ fastcgi_param PHP_VALUE "post_max_size=100M
76+ max_execution_time=200
77+ upload_max_size=100M
78+ upload_max_filesize=20M
79+ memory_limit=256M";
80+ fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
81+ include fastcgi_params;
82+ }
83+ }
8384}
0 commit comments