WordPress + Code Igniter Config not working

toddlahman nginx-forum at nginx.us
Fri Feb 21 22:23:06 UTC 2014


Could someone look over my configuration? It appears I am missing something
that is causing it not to work. I have a Code Igniter application that runs
from the root WordPress folder fine with Apache, but it is not working with
my Nginx configuration.

The WordPress root folder is: /var/www/vhosts/wordpress

The Code Igniter root folder is: /var/www/vhosts/wordpress/code_igniter

My config is:

		root   /var/www/vhosts/wordpress;

		location / {
			try_files $uri $uri/ @wordpress;
		}

		location @wordpress {
			try_files 					$uri =404;
			fastcgi_pass 				php;
			fastcgi_split_path_info 	^(.+\.php)(/.+)$;
			fastcgi_index 				index.php;
			fastcgi_param  			SCRIPT_FILENAME    $document_root$fastcgi_script_name;
			include 					/etc/nginx/fastcgi.conf;
		}

		location ~ /code_igniter/ {
			try_files 					$uri =404;
			fastcgi_pass 				php;
			fastcgi_split_path_info 	^(.+\.php)(/.+)$;
			fastcgi_index 				index.php;
			fastcgi_param  			SCRIPT_FILENAME   
$document_root/code_igniter/$fastcgi_script_name;
			include 					/etc/nginx/fastcgi.conf;
		}

		location ~ \.php$ {
			try_files 					$uri =404;
			fastcgi_pass 				php;
			fastcgi_split_path_info 	^(.+\.php)(/.+)$;
			fastcgi_index 				index.php;
			fastcgi_param  			SCRIPT_FILENAME    $document_root$fastcgi_script_name;
			include 					/etc/nginx/fastcgi.conf;
        }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,247861,247861#msg-247861



More information about the nginx mailing list