业务需求描述:
实际业务不存在index.html,需要重写访问index.php
URL为index.html,而实际访问的是index.php,对外被认为是html静态页面
①修改配置
shell > vim /usr/local/nginx/conf/nginx.conf
添加配置
rewrite /index.html /index.php last;
③重载配置测试访问
业务需求描述:
实际业务不存在index.html,需要重写访问index.php
URL为index.html,而实际访问的是index.php,对外被认为是html静态页面
①修改配置
shell > vim /usr/local/nginx/conf/nginx.conf
添加配置
rewrite /index.html /index.php last;
③重载配置测试访问