Welcome! Log In Create A New Profile

Advanced

Redirect subfolder with nginx

Posted by hellb0y77 
Redirect subfolder with nginx
September 15, 2014 10:14AM
Hi, i'm new to nginx, i need create a redirect with a subfolder.
I need redirect 2 link to same folder, ex.

www.domain.com ---> /path/to/files
www.domain.com/foo ---> /path/to/files

I have tried with "location" but don't work:

server {

listen 81;
server_name domain.com;
index index.php index.html;
root /path/to/files;
location /foo {
root /path/to/files;
index index.html;
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 212
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready