File tree Expand file tree Collapse file tree 1 file changed +57
-2
lines changed
Expand file tree Collapse file tree 1 file changed +57
-2
lines changed Original file line number Diff line number Diff line change 11server {
22 listen 80;
33 server_name {{.Domain }};
4- root /var/www/html ;
54 index index .php index .html ;
5+ charset off;
6+
7+ set $root_path /var/www/html ;
8+ root $root_path ;
9+
10+ client_max_body_size 108M;
11+ access_log /var/log/nginx/{{.Prefix }}_access.log ;
12+ error_log /var/log/nginx/{{.Prefix }}_error.log notice;
13+
14+ gzip on;
15+ gzip_comp_level 5;
16+ gzip_disable " msie6" ;
17+ gzip_types
18+ text/plain
19+ text/css
20+ application/json
21+ application/javascript
22+ application/x-javascript
23+ text/javascript
24+ text/xml
25+ application/xml
26+ application/xml+rss;
627
728 location / {
8- try_files $uri $uri / /index .php ?$query_string ;
29+ try_files $uri $uri / @rewrite;
30+
31+ location ~ [^/]\.ph (p\d*| tml)$ {
32+ try_files /does_not_exist @php;
33+ }
34+
35+ location ~* \. (avif| webp| jpg| jpeg| gif| png| svg| ico| mp4| webm| mkv| m4v| mp3| ogg| wav| aac| js | css| json| map| woff| woff2| ttf| otf| eot| zip| gz| bz2| rar| 7z| tar)$ {
36+ access_log off;
37+ expires max;
38+ break;
39+ }
40+ }
41+
42+ location @rewrite {
43+ rewrite ^. *$ /index .php last;
44+ }
45+
46+ location @php {
47+ fastcgi_index index .php ;
48+ fastcgi_pass {{.Prefix }}_php:9000;
49+ fastcgi_split_path_info ^((?U). +\.ph (?:p\d*| tml))(/?. +)$ ;
50+ try_files $uri = 404;
51+ include fastcgi_params;
52+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ;
53+ fastcgi_param PHP_VALUE " error_log=/var/log/nginx/{{.Prefix}}_php_error.log" ;
54+ }
55+
56+ location = /robots.txt {
57+ allow all;
58+ }
59+
60+ location = /sitemap.xml {
61+ allow all;
62+ add_header Content-Type text/xml;
63+ expires 1h;
964 }
1065}
You can’t perform that action at this time.
0 commit comments