im having difficulties with a relativity simple rewrite rules in nginx config.
All I want to do is, if requested dir or file 'host/my/request/path[/[index.php]]' does not exist, rewrite to 'host/my/request/path.php'
Current rewrite works for:
host
host/
host/my/request/path
But wont work for:
host/my/request/path/
Here is the rewrite part of the config:
location = /(.*)/ {
Im new to nginx and im trying to make my first server run. I followed this guide http://evansolomon.me/notes/faster-wordpress-multisite-nginx-batcache/ as im trying to use it for a multisite wordpress site.
Anyway after installing everything i get a 500 Internal server error.
im having difficulties with a relativity simple rewrite rules / router in nginx config.
All I want to do is, if requested dir or file 'host/my/request/path[/[index.php]]' does not exist, rewrite to 'host/my/request/path.php'
Current rewrite works for:
host
host/
host/my/request/path
But wont work for:
host/my/request/path/
Here is the rewrite part of the config:
location / {
I am trying to get rid of index.php from the default Zend Framework route. I think it should be corrected at the server level and not on the application.
I'm using Nginx with ISPConfig 3 to make the configuration and I'm getting rewrite or internal redirection cycle that I can't figure out with my limited knowledge of nginx.
[error] 13741#0: *64 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"
vhost config:
server {
lis
I want a request to http://example.com/foobar to return http://example.com/foobar.jpg. (Or .gif, .html, .whatever)
This is trivial to do with Apache MultiViews, and it seems like it would be equally easy in Nginx. This question seems to imply that it'd be easy as try_files $uri $uri/ index.php; in the location block, but that doesn't work.
I am following the nginx's wiki (http://wiki.nginx.org/WordPress) to setup my wordpress
location / {
try_files $uri $uri/ /index.php?$args;
}
By using the above lines, when a static file which is not found it will redirect to index.php of wordpress, that is okay but..
Problem: When I request an non-existence php script, e.g.
I'm a little new to Nginx here so bear with me -
I want to rewrite a url like foo.bar.com/newfoo?limit=30 to foo.bar.com/newfoo.php?limit=30.
Seems pretty simple to do it something like this rewrite ^([a-z]+)(.*)$ $1.php$2 last;
The part that I am confused about is where to put it - I've tried my hand at a some location directives but I'm doing it wrong.
Here's my existing virtual host conf
Still pretty new to nginx here, trying to get a simple rewrite to work, but the server just responds '404 not found'
My server block
server {
listen 80;
listen [::]:80;
server_name pics.example.com;
root /home/pics;
rewrite ^(.*)$ index.php?tag=$1;
location / {
try_files $uri $uri/ $uri.php /index.html $uri =404;
#try_files $uri =404;
fastcgi_split_path_info ^([a-z]+)(/.+)$;