Welcome! Log In Create A New Profile

Advanced

Redirecting folder index to common index file

Posted by sbx320 
Redirecting folder index to common index file
February 05, 2013 04:45PM
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?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready