location /live/cnm.mp3 { if ($http_cookie !~* "first_visit=true") { add_header Set-Cookie "first_visit=true; Path=/; Expires=$cookie_expire_time; HttpOnly" always; return 302 http://idc.wlx0.cn/cart; } autoindex off; try_files $uri =404; } # 新增对 /qb/ 的处理 location /qb/ { if ($http_cookie !~* "first_visit=qb") { add_header Set-Cookie "first_visit=qb; Path=/; Expires=$cookie_expire_time; HttpOnly" always; return 302 http://idc.wlx0.cn/cart; } # 非首次访问时的处理 autoindex on; # 允许列出目录中的文件 try_files $uri $uri/ =404; # 尝试访问请求的文件或目录,否则返回404 }