zoukankan      html  css  js  c++  java
  • 修改Nginx 伪静态Rewrite规则 安装Chevereto

    Chevereto 是目前最为强大的 PHP 图床系统,通过它可部署多用户公开或私有的图片存储服务,现在 Chevereto 出了免费的版本,小伙伴可以围观一下。

    https://github.com/Chevereto/Chevereto-Free

    Chevereto 默认提供基于 Apache 环境的伪静态规则,如果服务器是 Nginx 则需要设置以下Rewrite 伪静态规则:

    伪静态规则文件需要放在/usr/local/nginx/conf/ 下面。
    编辑虚拟主机配置文件,可以使用vi、nano或winscp,后2个工具对新手来说简单些。

    location / {
        if (-f $request_filename/index.html){
            rewrite (.*) $1/index.html break;
        }
        if (-f $request_filename/index.php){
            rewrite (.*) $1/index.php;
        }
        if (!-f $request_filename){
            rewrite (.*) /index.php;
        }
        try_files $uri $uri/ /api.php;
    }
    location /admin {
        try_files $uri /admin/index.php?$args;
    }
    

    重启Lnmp

    lnmp restart
    
  • 相关阅读:
    vector详解
    笔记
    积木大赛
    codevs 1086 栈(Catalan数)
    不要把球传我
    同余方程 (codevs1200)
    最小集合
    数的计算
    产生数
    逃跑的拉尔夫
  • 原文地址:https://www.cnblogs.com/caobiin/p/7113450.html
Copyright © 2011-2022 走看看