admin

宝塔nginx配置静态资源允许跨域访问
在server模块中添加配置: add_header 'Access-Control-Allow-Origin'...
扫描右侧二维码阅读全文
17
2018/09

宝塔nginx配置静态资源允许跨域访问

在server模块中添加配置:

 add_header 'Access-Control-Allow-Origin' '*';

例:

 server {
            listen       80;
            add_header 'Access-Control-Allow-Origin' '*';
            location /Roboto/ {
                root   /home/images;
                autoindex on;
            }
        }
Last modification:September 17th, 2018 at 12:02 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment