1,我在本地用nginx搭了一个web服务器,简单配置了下用来跑php,平时主要用来写一些前端的测试代码。我的代码目录结构大致如下:
/root/root/index.php // 站点入口,访问时靠php的header()函数让其直接跳转到/root/views/home/index.php/root/views/index.php // views中分了下目录相当于有不同的view/root/views/views-01/index.php/root/views/views-01/page-01.php/root/views/views-01/page-02.php/root/views/views-02/.../root/web/css/... // 各类CSS文件2,nginx配置
location / { index index.php index.html index.htm; rewrite ^/(.*)/$ /$1 redirect; if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; } } location ~ .*\.(jpg|png|css|js)$ { valid_referers none blocked life.yang.com; if ($invalid_referer){ return 404; } }3,问题
我故意在其中一个页面中把一个css文件的路径写错,然后查看浏览器中的请求,发现这个文件被请求了两次

相似问题