server {
    listen            80;

    client_max_body_size 200M;
	gzip              on;
	gzip_comp_level   4;
	gzip_min_length   1280;
	gzip_types        text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp application/json;
	gzip_vary         on;

    server_name pony.fm.local api.pony.fm.local;
    access_log  /vagrant/logs/nginx-access.log;
    error_log   /vagrant/logs/nginx-error.log;
    root        /vagrant/public;

    location / {
        index index.html index.php;
        location ~* \.(?:ttf|ttc|otf|eot|woff|font.css)$ {
            add_header "Access-Control-Allow-Origin" "*";
        }

        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php?/$1 last;
            break;
        }
    }

    location /dev-styles/ {
        alias /vagrant/app/styles/;
    }

    location /dev-scripts/ {
        alias /vagrant/app/scripts/;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    expires off;

    error_page 404 /index.php;
    error_page 403 /403.html;

    location /vagrant-files {
        internal;
        alias /vagrant-files/;
    }
}