浅忆博客

  • 学无止境
  • 技术相关
浅忆
~
  1. 首页
  2. 正文

chevereto nginx rewrite 规则

2019年10月16日 256点热度 0人点赞 0条评论

 
网上看了几篇规则倒是可以,但是我的用户名是admin,和后台管理界面冲突了,显示404。以下是官方的rewrite。

#Chevereto: Disable access to sensitive files
location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ {
    deny all;
}
#Chevereto: CORS headers
location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
    add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /images/ {
    location ~* (jpe?g|png|gif) {
        log_not_found off;
        error_page 404 /content/images/system/default/404.gif;
    }
    return 403;
}
#Chevereto: Pretty URLs
location / {
    index index.php;
    try_files $uri $uri/ /index.php?$query_string;
}

In case you installed Chevereto in a sub folder, the rules should look like this(如果您将Chevereto安装在子文件夹中,则规则应如下所示:):

#Chevereto: Disable access to sensitive files
location ~* /sub/(app|content|lib)/.*\.(po|php|lock|sql)$ {
    deny all;
}
#Chevereto: CORS headers
location ~* /sub/.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
    add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /sub/images/ {
    location ~* (jpe?g|png|gif) {
        log_not_found off;
        error_page 404 /sub/content/images/system/default/404.gif;
    }
    return 403;
}
#Chevereto: Pretty URLs
location /sub/ {
    index index.php;
    try_files $uri $uri/ /sub/index.php?$query_string;
}

原文:https://chevereto.com/community/threads/nginx-rewrite-rules.9295/

标签: 暂无
最后更新:2019年10月16日

浅忆

时间还是一样的时间,不紧不慢地流走着,或许还会带走些什么,也会留下些什么,一切都按着原有的轨迹有序地进行。

点赞

文章评论

取消回复

COPYRIGHT © 2022 浅忆博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang