Skip to content

Instantly share code, notes, and snippets.

@risyasin
Last active August 29, 2015 14:16
Show Gist options
  • Save risyasin/fa97a1f1d084239981f7 to your computer and use it in GitHub Desktop.
Save risyasin/fa97a1f1d084239981f7 to your computer and use it in GitHub Desktop.
Sample nginx vhost domain with php fw setup
server {
listen 80;
server_name {{@domain}};
root {{@root_path}};
location / {
error_page 404 /index.php;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$query_string;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
location ~ /ui {
autoindex on;
}
location ~* ^.+.(css|js|jpeg|jpg|gif|png|ico) {
expires 30d;
}
location ~ /Icon {
deny all;
}
location ~ /\.ht {
deny all;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param APP_ENV development;
fastcgi_param APP_DEV yasin;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_read_timeout 600;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment