Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Forked from dall/gist:1988355
Created March 6, 2012 19:14
Show Gist options
  • Save lorenzo/1988362 to your computer and use it in GitHub Desktop.
Save lorenzo/1988362 to your computer and use it in GitHub Desktop.
root@vmi2495:/etc/nginx/sites-enabled# cat test.it
server {
listen 80;
server_name test.it;
rewrite ^(.*) http://www.test.it$1 permanent;
}
server {
listen 80;
server_name www.test.it;
location / {
root /home/users/test.it/www/app/webroot/;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
}
location ~ .*\.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /home/users/test.it/www/app/webroot$fastcgi_script_name;
}
}
server {
listen 80;
server_name mysql.test.it;
root /home/users/test.it/mysql;
location / {
# root /home/users/test.it/mysql;
index index.php;
}
location ~ \.php$ {
#try_files $uri =404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment