Skip to content

Instantly share code, notes, and snippets.

@tristanbes
Created August 25, 2014 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tristanbes/f15e9269cf63b5a52340 to your computer and use it in GitHub Desktop.
Save tristanbes/f15e9269cf63b5a52340 to your computer and use it in GitHub Desktop.
server {
listen 8080;
root /path/to/current/web;
server_name admin.*;
location / {
try_files $uri @rewriteadmin;
}
location @rewriteadmin {
rewrite ^(.*)$ /admin.php/$1 last;
}
location ~ ^/(site|site_dev|admin|admin_dev)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 240;
fastcgi_max_temp_file_size 0;
}
location ~* \.(jpg|jpeg|png|gif|ico)$ {
log_not_found off;
access_log off;
}
access_log /var/log/nginx/admin_access.log main buffer=16k;
error_log /var/log/nginx/admin_error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment