如何配置Nginx位置?

pdkcd3nj  于 2022-11-02  发布在  Nginx
关注(0)|答案(1)|浏览(119)

我在nginx.conf中有一个代码:

location ~ ^/(?!(confirm.html)) {
if ($http_cookie !~* "session") {
     set $block "true";
  }
if ($http_user_agent ~* (Google|google|Googlebot|Googlebot-Image|Google-Site-Verification|Google\ Web\ Preview|bing|Bing|Yahoo|yahoo)) {
      set $block "false";
}
if ($block = "true") {
    return 302 /confirm.html;
}
try_files $uri $uri/ /index.php?q=$uri&$args;
}

我想添加另一个代码:

location /theme {
proxy_pass  http://localhost/theme;
}

但是它不起作用,我也不知道怎么解决它。谁能帮我?

mlnl4t2r

mlnl4t2r1#

我解决了我的问题:

location ~ ^/(?!(confirm.html|theme)) {

相关问题