Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
702 B
1
Indexable
Never
server {
    listen 80;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
        error_page 405 = @handle_options;
    }

    location @handle_options {
        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
            add_header 'Access-Control-Max-Age' 1728000;
            add_header 'Content-Type' 'text/plain; charset=utf-8';
            add_header 'Content-Length' 0;
            return 204;
        }
    }
}