Created
November 18, 2014 17:26
-
-
Save zacharyblank/8aab2233735351327b7a to your computer and use it in GitHub Desktop.
This file contains 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
# Remove /v1/ from the request uri | |
map $request_uri $post_uri { | |
~^/v1(?P<uri_string>.*)$ $uri_string; | |
} | |
# Main Host | |
server { | |
listen 80; | |
server_name host; | |
# Set Logs based on API version | |
error_log /var/log/nginx/error.log debug; | |
access_log /var/log/nginx/access.log; | |
root /vagrant/api/v1/public; | |
if ($request_uri ~* ^/v1) { | |
rewrite ^/(.*)$ /$1 last; | |
} | |
location / { | |
try_files $uri /index.php?$query_string; | |
} | |
server_tokens off; | |
client_max_body_size 20m; | |
client_body_buffer_size 128k; | |
fastcgi_intercept_errors off; | |
location ~ \.php$ { | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_param REQUEST_URI $post_uri; | |
fastcgi_param ENVIRONMENT development; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment