#+title: Track website visit statistics * Setup lighttpd On the config file append the proxy to the running lisp server #+begin_src conf server.modules += ( "mod_proxy" ) $HTTP["url"] =~ "^/stats/" { proxy.server = ("" => ( "hunchentoot" => ( "host" => "127.0.0.1", "port" => 4252 ) ) ) proxy.header = ( "map-urlpath" => ( "/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