1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| server { listen 80; server_name domain.com;
index index.php; root /wwwroot/project_path;
access_log /log_path/xxx.log; error_log /log_path/xxx_error.log;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ { fastcgi_pass unix:/run/php/php8.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
location ~ /\.ht { deny all; }
location ~ .*\.(js|css|json|txt)?$ { expires 7d; }
location ~ .*\.(eot|ttf|otf|woff|svg)$ { expires 30d; }
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ { expires 30d; }
gzip on; gzip_min_length 1k; gzip_static on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml text/javascript application/javascript application/x-javascript text/x-json application/json application/x-web-app-manifest+json text/css text/plain text/x-component font/opentype font/ttf application/x-font-ttf application/vnd.ms-fontobject image/x-icon image/png image/jpeg image/gif image/bmp image/ief; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; }
|