浏览代码

[Nginx] Add qhandler rewrite
[Web] Move theme header include, fixes #2267

andryyy 6 年之前
父节点
当前提交
5efdf71120
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 4 0
      data/conf/nginx/site.conf
  2. 4 3
      data/web/inc/header.inc.php

+ 4 - 0
data/conf/nginx/site.conf

@@ -63,6 +63,10 @@ server {
     try_files $uri $uri/ @strip-ext;
   }
 
+  location /qhandler {
+    rewrite ^/qhandler/(.*)/(.*) /qhandler.php?action=$1&hash=$2;
+  }
+
   location /edit {
     rewrite ^/edit/(.*)/(.*) /edit.php?$1=$2;
   }

+ 4 - 3
data/web/inc/header.inc.php

@@ -7,9 +7,7 @@
   <meta name="theme-color" content="#F5D76E"/>
   <meta http-equiv="Referrer-Policy" content="same-origin">
   <title><?=$UI_TEXTS['title_name'];?></title>
-  <?php if (strtolower(trim($DEFAULT_THEME)) != "lumen"): ?>
-  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/<?= strtolower(trim($DEFAULT_THEME)); ?>/bootstrap.min.css">
-  <?php endif;
+  <?php
     if (preg_match("/mailbox/i", $_SERVER['REQUEST_URI'])) {
       $css_minifier->add('/web/css/site/mailbox.css');
     }
@@ -30,6 +28,9 @@
     }
   ?>
   <style><?=$css_minifier->minify();?></style>
+  <?php if (strtolower(trim($DEFAULT_THEME)) != "lumen"): ?>
+  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/<?= strtolower(trim($DEFAULT_THEME)); ?>/bootstrap.min.css">
+  <?php endif; ?>
   <link rel="shortcut icon" href="/favicon.png" type="image/png">
   <link rel="icon" href="/favicon.png" type="image/png">
 </head>