Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Redirecting folder index to common index file

$
0
0
Hi,

I'm currently moving my webpage from lighttpd to nginx. Everything is fine except for my gallery. My gallery currently uses the following directory structure
root
- gallery.php
- images1/
- image1.png
- image2.png
- images2/
[etc.]

Now I need the index file of any directory to be gallery.php out of the root directory. Using lighttpd I used this config:
$HTTP["url"] =~ "^/.+($|/)" {
index-file.names = ("../gallery.php")
}

Using nginx I've been trying the following, which does not work:
location = "/.*($|/)" {
index /genthumb.php;
}

This only gives me an error in nginx' error log:
2013/02/05 23:42:12 [error] 4004#0: *1 directory index of "/var/www-pub/gallery/" is forbidden, client: 217.231.250.210, server: gallery-dev.*, request: "GET / HTTP/1.1", host: "gallery-dev.mydomain.com"

Is there any simple way to fix this issue, or do I need to copy my gallery.php around?

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>