Hi,
I am migrating from Apache server to Nginx.
I am finding it very difficult. My Nginx version is 0.8.5.3 on Redhat server.
Below is my conf file.
===================================
server {
listen www.testdomain.com:80;
server_name www.testdomain.com testdomain.com;
location / {
root /home/vhosts/testdomain.com/httpdocs/;
index index.php index.html index.htm;
}
rewrite "^/us$" /us/ permanent; break;
#if (!-f $request_filename){
# set $rule_3 1$rule_3;
#}
#if (!-d $request_filename){
# set $rule_3 2$rule_3;
#}
#if ($rule_3 != "21"){
# rewrite /. /rewriteurl.php;
#}
try_files $uri /rewriteurl.php;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root /home/vhosts/testdomain.com/httpdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
include fastcgi_params;
fastcgi_intercept_errors on;
error_page 404 $document_root/errorpage.php;
}
}
==============================
As you can see I am simply trying to do redirection of non existing files or directory into one single file rewriteurl.php where I am handing all the rewriteurl cases.
I have also tried to setup using if -d and -f option but that also does not seem to work.
But somehow this is not working.
Can some buddy help me. I am in deep trouble here???
Any ideas?
Thanks in Advance.
Nilicon Jefferson.