• 本站域名更换为 qyi.io

chevereto nginx rewrite 规则

学无止境 admin 2年前 (2019-10-16) 1159次浏览 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/


版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:chevereto nginx rewrite 规则
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址