lnmp环境下TP框架的项目nginx配置文件的设置-创新互联
                                            开发时用的apache服務器。TP框架。

lnmp服务器(lnmp.org):
lnmp add后自动生成的配置文件为:
server
{
listen 80;
#listen [::]:80;
server_name  ---.----.--;
index index.html index.htm index.php default.html default.htm default.php;
root  /home/wwwroot/----/public;
    include none.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 ~ /\.
    {
        deny all;
    }
    access_log off;
}~
~
~
~
~
这样的话
本地,---.----.--/admin能够打开,
服务器上 ---.----.--/admin 就报nginx 的 404错误了!404 Not Found
增加后面几行。
修改后,再lnmp restart.
就好了!
[root@hkdata02 vhost]# vi ---.----.--.conf
    #listen [::]:80;
    server_name ---.----.--;
    index index.html index.htm index.php default.html default.htm default.php;
    root  /home/wwwroot/---/public;
    #include other.conf;
    #error_page   404   /404.html;
    # Deny access to PHP files in specific directory
    #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
    include enable-php.conf;
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires      12h;
    }
    location ~ /.well-known {
        allow all;
    }
    location ~ /\.
    {
        deny all;
    }
    if ( !-e $request_filename) {
        rewrite ^(.*)$ /index.php?s=$1 last;
        break;
    }
    access_log  /home/wwwlogs/---.----.--.log;
}另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网页标题:lnmp环境下TP框架的项目nginx配置文件的设置-创新互联
文章出自:http://www.scyingshan.cn/article/cdgeji.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 