输网址的时候注意别写成localhost/8080 要写成localhost:8080。
server {
listen 8083;
#Access-Control-Allow-Origin *
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Origin,X-Requested-Width,Content-Type,Accept';
add_header 'Access-Control-Allow-Methods' '*';
add_header Access-Control-Max-Age 1728000;
if ($request_method = 'OPTIONS') {
return 204;
}
location /ter {
alias D:/qingxie/chang7chang8fenjie/3Dtiles/chang7chang8fenjiexian_3Dtiles/;
autoindex on;
autoindex_localtime on;
}
}
请求时:若访问到文件列表,成功
http://localhost:8083/ter/
cesium中请求:
url: "http://localhost:8083/ter/tileset.json",
注意ctrl+shift+delete
这几天时常被莫名的问题折磨一天才能解决,甚至解决不了,需要思考一下为什么。
./nginx -s quit 优雅地停止。
写于6A407