nginx php按需生成静态
nginx.conf
try_files $uri /file.php?path=$uri;
file.php
<?php
file_put_contents($_SERVER['DOCUMENT_ROOT'].$_GET['path'], date('Y-m-d H:i:s'));
header('Location: '.$_GET['path']);
nginx.conf
try_files $uri /file.php?path=$uri;
file.php
<?php
file_put_contents($_SERVER['DOCUMENT_ROOT'].$_GET['path'], date('Y-m-d H:i:s'));
header('Location: '.$_GET['path']);