Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Last active November 12, 2015 14:08
Show Gist options
  • Save remcotolsma/8b0a8ea85e59baa5f5b1 to your computer and use it in GitHub Desktop.
Save remcotolsma/8b0a8ea85e59baa5f5b1 to your computer and use it in GitHub Desktop.
nginx.conf
server {
listen 80;
server_name *.dev;
root /Users/remco/Websites/$host/;
access_log /usr/local/etc/nginx/logs/default.access.log main;
location / {
include /Users/remco/Websites/php-fpm.conf;
try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
error_page 403 /403.html;
}
worker_processes 1;
error_log /usr/local/etc/nginx/logs/error.log debug;
events {
worker_connections 256;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /usr/local/etc/nginx/logs/access.log main;
sendfile on;
keepalive_timeout 65;
index index.html index.php;
# Upstream to abstract backend connection(s) for PHP.
# upstream php {
# #this should match value of "listen" directive in php-fpm pool
# server unix:/tmp/php-fpm.sock;
# server 127.0.0.1:9000;
# }
client_max_body_size 64m;
include /Users/remco/Websites/nginx.conf;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment