Skip to content

Instantly share code, notes, and snippets.

@madmis
Forked from leon/nginx.conf
Last active August 29, 2015 14:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madmis/a21e6bdcaaa707a678d5 to your computer and use it in GitHub Desktop.
Save madmis/a21e6bdcaaa707a678d5 to your computer and use it in GitHub Desktop.
server {
listen 80;
root /home/dimon/www/avto.dev/web/;
server_name avto.dev;
set $front_part app_dev;
set $front $front_part.php;
rewrite ^/$front_part\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
rewrite ^(.*)$ /$front/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index $front;
send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# Statics
location /(bundles|media) {
access_log off;
expires 30d;
# Font files
#if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
# add_header Access-Control-Allow-Origin *;
#}
try_files $uri @rewriteapp;
}
access_log /var/log/nginx/avto.dev-access.log;
error_log /var/log/nginx/avto.dev-error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment