diff options
Diffstat (limited to 'webstats/readme.org')
-rw-r--r-- | webstats/readme.org | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/webstats/readme.org b/webstats/readme.org index d3908e9..a720673 100644 --- a/webstats/readme.org +++ b/webstats/readme.org @@ -18,3 +18,23 @@ $HTTP["url"] =~ "^/stats/" { } #+end_src + +Setting up CORS +#+begin_src conf +server.modules += ( "mod_setenv" ) + # For CORS we need to allow all origins + setenv.add-response-header += ( + "Access-Control-Allow-Origin" => "*", + "Access-Control-Allow-Credentials" => "true" + ) + # For CORS OPTIONS requests we should say which methods are allowed + $HTTP["request-method"] == "OPTIONS" { + setenv.add-response-header += ( + "Access-Control-Allow-Methods" => "GET, POST, OPTIONS", + "Access-Control-Expose-Headers" => "Content-Range, Date, Etag, Cache-Control, Last-Modified", + "Access-Control-Allow-Headers" => "Content-Type, Origin, Accept, Range, Cache-Control", + "Access-Control-Max-Age" => "600", + "Timing-Allow-Origin" => "*" + ) + } +#+end_src |