Nginx靜態資源伺服器配置

zpfnext發表於2020-10-04
server {
    listen: 8081;
    server_name: resoure 
    root C:/Users/cxc05/Desktop/resource 
    autoindex on //可以檢視resource下的目錄
    location / {
        add_header Access-Control-Allow-Origin * //允許跨域
        }
    add_header Cache-Control "no-cache,must-revalidate" //不允許快取,每次訪問都要重新重新整理
}

相關文章