Last active
August 29, 2015 13:56
-
-
Save derekperkins/8969018 to your computer and use it in GitHub Desktop.
nginx config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /home/nozzle/htdocs/webroot; | |
index index.php index.html index.htm; | |
server_name local.nozzle.io; | |
location / { | |
if ($request_method = OPTIONS ) { | |
add_header 'Access-Control-Allow-Origin' *; | |
add_header 'Access-Control-Allow-Headers' 'origin, x-requested-with, content-type, accept'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Content-Length' 0; | |
return 204; | |
} | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location ~ \.php$ { | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass unix:/var/run/nozzle-php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location /robots.txt { | |
rewrite ^/robots.txt$ /robots.txt.php last; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment