nginx CORS Issues with MAXCDN and Easydns with Digital Ocean

I am having issues with CORS, specifically with max cdn. CORS was working properly with maxcdn until a few days ago. I have posted my host config and the cors header is included.

I am stumped at this point, as I have done the following to troubleshoot:

Read More
  • Disabled a rocket-cache specific configuration for nginx included in
    the server block.
  • I have changed caching methods – rather than redis-hhvm I have tried
    switching over to fcgi-hhvm with rocket cache.
  • I have disabled rocket cache after clearing it’s cache – then purging
    the entire cache, and used a third party plugin for wordpress
    specifically for linking the cdn.

I am using SNI with SPDY on maxcdn – I have a cert just for the subdomain (cdn.jurisdesk.com). And I am using Digitalocean for hosting.

Below is my current nginx config (everything was working properly until a few days ago which prompted me to speak with maxcdn support – who are great by the way, and extremely knowledgeable when it comes to advanced configurations specifically using nginx).

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 "*";
 }

}

I have also added CORS to rocket-nginx.conf – as this is something I’ve been tinkering with lately and reflects a change to my config – however I have also removed the directive to eliminate that as the cause of the problem.

Related posts