Skip to content

Instantly share code, notes, and snippets.

@skyler
Created May 13, 2012 21:50
Show Gist options
  • Save skyler/2690402 to your computer and use it in GitHub Desktop.
Save skyler/2690402 to your computer and use it in GitHub Desktop.
Bugjar Nginx config file
server {
listen 80 default;
server_name bugjar.git www.bugjar.git;
access_log /var/log/nginx/bugjar_access.log;
error_log /var/log/nginx/bugjar_errors.log;
root /home/skyler/workspace/bugjar/public;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
include /home/skyler/workspace/bugjar/public/*.ngaccess;
location / {
try_files $uri $uri/ $uri.php;
}
# handle PHP requests
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_pass unix:/tmp/php.socket;
try_files $uri = 404;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
# deny access to our custom .ngaccess files
location ~ /.*\.ngaccess.* {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment