{ # 路由规则 route / { # 跨域需要加的请求头 header Access-Control-Allow-Origin * header Access-Control-Allow-Methods GET, POST, OPTIONS header Access-Control-Allow-Headers authorization,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type

    # OPTIONS 请求直接返回 204
    @options {
        method OPTIONS
    }
    respond @options 204
    
    # tp需要加的伪静态
    @notfound {
        not file {path}
    }
    rewrite @notfound /index.php?s={uri}
}
nginx规则location 	#跨域需要加的请求头	add_header Access-Control-Allow-Origin ; 	add_header Access-Control-Allow-Methods GET POST OPTIONS; 	add_header Access-Control-Allow-Headers authorizationAuthorizationDNTX

原文地址: http://www.cveoy.top/t/topic/ez6n 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录