我有以下 nginx 配置:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php;
server_name _;
if ($uri = /foobar) {
break;
}
if ($remote_addr != 1.2.3.4) {
rewrite ^ https://google.com redirect;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
我是否必须http://我的域名.tld/或者http://mydomain.tdl/foobar,我被重定向到 Google。我以为break
应该停止处理 ngx_http_rewrite_module 指令?