Skip to content

Instantly share code, notes, and snippets.

@fnordfish
Created May 22, 2014 20:03
Show Gist options
  • Select an option

  • Save fnordfish/a1cc3487573bd9a54e3e to your computer and use it in GitHub Desktop.

Select an option

Save fnordfish/a1cc3487573bd9a54e3e to your computer and use it in GitHub Desktop.
agavi nginx
server {
listen 80;
server_name ~^(?<client>.+).fe\.project\.dev $hostname fe.project.dev;
set $root /home/vagrant/project/current/FrontApp/pub;
access_log /var/log/nginx/fe.project.dev.access.log;
error_log /var/log/nginx/fe.project.dev.error.log;
location ^~ /assets/ {
root /static_asset_cache/;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
}
location /autodiscover/autodiscover.xml {
return 404;
}
location / {
root $root;
index index.php;
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9001; # unix:/tmp/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
#fastcgi_param PATH_INFO $fastcgi_script_name;
# we need to rewrite the SERVER_NAME since nginx seems to pass the first server_name literally, not expanded
fastcgi_param SERVER_NAME $host;
# setting the agavi-environment
fastcgi_param AGAVI_ENVIRONMENT development-vagrant;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment