http {
#fastcgi_cache_path /var/www/html/fastcache levels=1:2 keys_zone=wali:100m max_size=1g inactive=60m;
server {
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.htm index.nginx-debian.html index.php;
server_name www.jiangjianyi.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
#rewrite ^/(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.(html|php)$ {
include snippets/fastcgi-php.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
# With php-cgi (or other tcp sockets):
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_cache_key $scheme$request_method$host$request_uri$is_args$args;
#fastcgi_cache wali;
#fastcgi_cache_valid 200 60m;
#add_header X-Cache-Source $upstream_cache_status;
}
location ~.*\.(html|img|jpg|png|gif|js|css|ttf)$ {
expires 30d;
}
}
}