Sep 162010
 

If you set

   location /mail/ {
       fastcgi_pass localhost:8888;
       ...
   }

and request “/mail” then nginx will return external redirect to “/mail/”.
If you do not want the redirect, then

   location = /mail {
       fastcgi_pass   localhost:8888;
       fastcgi_param  SCRIPT_FILENAME    $document_root/index.php;
       fastcgi_param  SCRIPT_NAME        /index.php;
       root           /var/www;
   }

   location /mail/ {
       fastcgi_pass   localhost:8888;
       fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
       fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
       fastcgi_index  index.php;
       root           /var/www;
   }

or set

server_name_in_redirect off;
Jan 302010
 

I’ve just found this great articles at Jim Plank website. I know, it was lots easier using linux du command

Without any further nonsense talk, here we go. First we need download some source code at Jim Plank website

# mkdir prsize
# cd prsize
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/notes/Prsize/prsize8.c
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/src/dllist.c
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/notes/Dllists/dllist.h
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/src/jrb.c
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/include/jrb.h
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/src/jval.c
# wget http://www.cs.utk.edu/~plank/plank/classes/cs360/360/include/jval.h

prsize8.c is the main program, while dllist.c/h jrb.c/h jval.c/h is library that prsize8 statically linked in.

Now we need to create some static library.(Original website doesn’t explain how to create the libs)

# gcc -c dllist.c -o dllist.o
# gcc -c jrb.c -o jrb.o
# gcc -c jval.c -o jval.o

# ar rcs libdllist.a dllist.o
# ar rcs libjrb.a jrb.o
# ar rcs libjval.a jval.o

Continue reading »