Hello guys,
The problem is with the rewrite rules: I'm not sure if I need to include something in order to get the rewrite module included in nginx. Any idea or help will be appreciated! Before writing I tried looking into the forum to see if someone was having the same problem but I seems that it does not.
here is my nginx's configuration file:
server {
listen 80 default_server;
server_name example.com;
rewrite ^(.*)$ index.php?url=$1 last;
rewrite testing index.php last;
root /home/victor/Documents/web/example.com;
error_log /home/victor/Documents/web/logs/example.log;
index index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
When I try in the browser with http://example.com it works.
When I try in the browser with http://example.com/something it does NOT work.
When I try in the browser with http://example.com/testing it does NOT work too.
This is the ouput of the log file:
2014/08/07 14:55:30 [error] 5700#0: *1 open() "/home/victor/Documents/web/example.com/something" failed (2: No such file or directory), client: 127.0.0.1, server: example.com, request: "GET /something HTTP/1.1", host: "example.com"
2014/08/07 15:47:29 [error] 5996#0: *1 open() "/home/victor/Documents/web/example.com/testing" failed (2: No such file or directory), client: 127.0.0.1, server: example.com, request: "GET /testing HTTP/1.1", host: "example.com"
Thanks in advance!
The problem is with the rewrite rules: I'm not sure if I need to include something in order to get the rewrite module included in nginx. Any idea or help will be appreciated! Before writing I tried looking into the forum to see if someone was having the same problem but I seems that it does not.
here is my nginx's configuration file:
server {
listen 80 default_server;
server_name example.com;
rewrite ^(.*)$ index.php?url=$1 last;
rewrite testing index.php last;
root /home/victor/Documents/web/example.com;
error_log /home/victor/Documents/web/logs/example.log;
index index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
When I try in the browser with http://example.com it works.
When I try in the browser with http://example.com/something it does NOT work.
When I try in the browser with http://example.com/testing it does NOT work too.
This is the ouput of the log file:
2014/08/07 14:55:30 [error] 5700#0: *1 open() "/home/victor/Documents/web/example.com/something" failed (2: No such file or directory), client: 127.0.0.1, server: example.com, request: "GET /something HTTP/1.1", host: "example.com"
2014/08/07 15:47:29 [error] 5996#0: *1 open() "/home/victor/Documents/web/example.com/testing" failed (2: No such file or directory), client: 127.0.0.1, server: example.com, request: "GET /testing HTTP/1.1", host: "example.com"
Thanks in advance!