[eluser]Fabdrol[/eluser]
Hi guys,
I've got a Nginx config problem, and I was hoping that there's somebody who could help me.
I've got a public directory with a directory 'blog' in it, and in that is a wordpress blog. In the public dir there's also the index.php from CodeIgniter, and all requests are routed to that Index.php.
Now I need a directive in my config which makes sure that 'blog' is handled seperatly (e.g., not routed to public/index.php). How can I achieve that?
Thank you very much!
Code:
server {
listen 80;
server_name example.com www.example.com;
access_log /home/www/logs/access.log;
error_log /home/www/logs/error.log;
root /home/www/public;
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
break;
}
if ($host ~* www\.(.*)) {
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}
location / {
try_files $uri @codeigniter;
rewrite ^\/beta\/index.php/(.*)$ http://example.com/$1 permanent;
rewrite ^\/beta\/(.*)$ http://example.com/$1 permanent;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?/$1 last;
}
}
location @codeigniter {
internal;
root /home/www/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_config;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/www/public/index.php;
}
# If directly accessing a PHP file in the public dir other than index.php
location ~* \.php$ {
root /home/www/public;
try_files $uri @codeigniter;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_config;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}