我遇到CORS问题,特别是max cdn。几天前CORS与maxcdn合作正常。我已经发布了我的主机配置,并且包含了cors标头。
我在这一点上很难过,因为我已经做了以下排查:
我在maxcdn上使用SNI和SPDY - 我有一个仅适用于子域名的证书(cdn.jurisdesk.com)。我正在使用Digitalocean进行托管。
下面是我当前的nginx配置(一切正常,直到几天前,这促使我与maxcdn支持人员交流 - 顺便说一下,他们非常了解,特别是在使用nginx的高级配置方面非常了解)。
var state = {
navigations: []
};
$scope.state = state;
state.navigations = navigationService.navigations; // i prefer such syntax
// or
$scope.state.navigations = navigationService.navigations;
我还将CORS添加到server {
server_name www.jurisdesk.com;
ssl_certificate_key /path/to/key/foobar.key;
ssl_certificate /path/to/cert/foobar.crt;
listen *:80;
listen *:443 ssl spdy;
listen [::]:80 ipv6only=on;
listen [::]:443 ssl spdy ipv6only=on;
return 301 https://jurisdesk.com$request_uri;
}
server {
server_name jurisdesk.com;
listen *:80;
listen [::]:80;
return 301 https://jurisdesk.com$request_uri;
}
server {
server_name jurisdesk.com;
listen *:443 ssl spdy;
listen [::]:443 ssl spdy;
ssl on;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
ssl_certificate_key /path/to/key/foobar.key;
ssl_certificate /path/to/cert/foobar.crt;
access_log /var/log/nginx/jurisdesk.com.access.log rt_cache_redis;
error_log /var/log/nginx/jurisdesk.com.error.log;
root /var/www/jurisdesk.com/htdocs;
index index.php index.html index.htm;
include common/redis-hhvm.conf;
include rocket-nginx/rocket-nginx.conf;
include common/wpcommon.conf;
include common/locations.conf;
location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}
}
- 因为这是我最近一直在修改并反映我的配置的更改 - 但是我也删除了指令以消除这是问题的原因。