chenkehao 发表于 2018-11-10 08:02:09

nginx跨域

server {  
    listen 8080;
  
    include enable-php.conf;
  
    root   /home/wwwroot/image;
  
    location /
  
                {
  
                add_header 'Access-Control-Allow-Origin' 'http://www.tisunion.com';
  
                add_header 'Access-Control-Allow-Credentials' 'true';
  
                add_header 'Access-Control-Allow-Methods' 'GET';
  
                }
  
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  
                {
  
            expires      30d;
  
                }
  
    location ~ /\.
  
                {
  
                deny all;
  
                }
  
   access_log/home/wwwlogs/image.logaccess;
  
       }


页: [1]
查看完整版本: nginx跨域