Welcome! Log In Create A New Profile

Advanced

Confused with the Equal modifier...

Posted by imRahulSoni 
Confused with the Equal modifier...
October 12, 2015 08:31AM
This is how my configuration looks like...

server {
listen 80;
server_name 127.0.0.1 localhost;

location = / {
index index.html;
}

location / {
root /etc/nginx/html/app1;
}
}


In my folder app1 I have two files, index.html & home.html

If I browse http://localhost/ or http://localhost/index.html or http://localhost/home.html page it comes up well.

When I change the configuration like so...

server {
listen 80;
server_name 127.0.0.1 localhost;

location = / {
index home.html;
}

location / {
root /etc/nginx/html/app1;
}
}

http://localhost:8888/index.html > works
http://localhost:8888/home.html > works
http://localhost:8888/ > 403 forbidden!!!

Can someone please tell me what is wrong?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 209
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