我是靠谱客的博主 认真荔枝,这篇文章主要介绍nginx配置php的目录,nginx 配置使用index.php作为目录的默认加载文件,现在分享给大家,希望可以做个参考。

配置如下:

在server增加一行:

index index.php index.html index.htm default.php default.htm default.html

增加后如下:

server

{

listen 100;

index index.php index.html index.htm default.php default.htm default.html;

root /www/wwwroot/manager/public;

include enable-php-70.conf;

if (!-e $request_filename) {

rewrite ^/(.+)$ /index.php last;

}

location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$

{

expires 30d;

}

location ~ .*.(js|css)?$

{

expires 1h;

}

location /.git

{

deny all;

return 403;

}

access_log /www/wwwlogs/manager.com.log;

error_log /www/wwwlogs/manager.com.error.log;

}

标签:index,log,default,htm,nginx,html,php

来源: https://www.cnblogs.com/liyuanhong/p/12066111.html

最后

以上就是认真荔枝最近收集整理的关于nginx配置php的目录,nginx 配置使用index.php作为目录的默认加载文件的全部内容,更多相关nginx配置php的目录,nginx内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部