时间:2023-02-07 22:08:01 | 来源:建站知识
时间:2023-02-07 22:08:01 来源:建站知识
准备:server { listen 80; #listen [::]:80; server_name bbs.test.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/bbs.test.com/; include other.conf; #error_page 404 /404.html; include enable-php.conf; location ~ .*/.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*/.(js|css)?$ { expires 12h; } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~ //. { deny all; } access_log /home/wwwlogs/bbs.test.com.log; }
完成之后。重启nginx #nginx命令 start: /usr/local/nginx/sbin/nginx stop: /usr/local/nginx/sbin/nginx -s stop reload: /usr/local/nginx/sbin/nginx -s reload
4 测试: 在你二级域名文件夹。添加一个文件,访问,就可以了。。关键词:配置