after nginx is configured to access cross-domain access, get,post can be accessed, but the put method is not allowed
the specific configuration is as follows
add_header Access-Control-Allow-Origin *;
location / {
if ($request_method = "OPTIONS") {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
return 204;
}
then reported the wrong prompt
index.html:1 Failed to load http://ms.iot-sw.net:7880/service/v1/shareport/park/4: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.
does any great god know how to configure and support the put method