Skip to content

Instantly share code, notes, and snippets.

@melloc01
Last active September 23, 2015 22:30
Show Gist options
  • Save melloc01/31035434e7c1f64d1583 to your computer and use it in GitHub Desktop.
Save melloc01/31035434e7c1f64d1583 to your computer and use it in GitHub Desktop.
Default API Apache Config
<VirtualHost *:80>
ServerName api.sellead.dev
DocumentRoot /var/www/sellead.dev/api/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/sellead.dev/api>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /fcgi-bin/ /var/www/sellead.dev/fcgi-bin/
ErrorLog /var/www/sellead.dev/logs/error.log
CustomLog /var/www/sellead.dev/logs/access.log combined
LogLevel debug
# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
#Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment