在nginx上配置了个新的域名,不知道为啥没有生效,nginx -t检查了配置文件也没有任何问题;域名也对啊
配置文件你发出来看看啊,你这种问题多的很。比如你域名都没有备案。或者你监听端口不对。
你的域名是否解析到你的ip上了呢?你ping下你的域名,看看能不能解析到ip,
域名解析了吗
【相关推荐】
location / {
if ($request_method = OPTIONS ) {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, DELETE";
add_header Access-Control-Max-Age "3600";
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization";
add_header Access-Control-Allow-Credentials "true";
add_header Content-Length 0;
add_header Content-Type text/plain;
return 200;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type,*';
}