Skip to content

Instantly share code, notes, and snippets.

@pyrmont
Last active December 21, 2015 17:49
Show Gist options
  • Save pyrmont/6342859 to your computer and use it in GitHub Desktop.
Save pyrmont/6342859 to your computer and use it in GitHub Desktop.
Basic Nginx configuration file.
daemon off;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /usr/local/etc/nginx/mime.types; # Update if necessary
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
root /path/to/your/dev/site; # Replace with the correct path
index index.html index.htm index.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
include /usr/local/etc/nginx/fastcgi.conf; # Update if necessary
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~ /\.ht {
deny all;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment