Welcome! Log In Create A New Profile

Advanced

How to Access 2 diffrent html page using NGINX web server

Posted by mahen025 
How to Access 2 diffrent html page using NGINX web server
October 23, 2014 07:19AM
Hi Team,

I am new to Nginx web server and i have a 2 diffrent html page in my html folder namely index.html and index2.html.

how can i access both HTML using Nginx.

I have configured listening port as 8060. and if i try to access http://localhost:8060 then it redirects to index.html. same way if i access http://localhost:8060\index2.html then its not referring index2.html instead its referring index.html.

nginx.conf done as below

location / {
root html;
index index.html index.htm;
allow 192.168.10.65;
allow 192.168.10.75;
deny all;
}
location /html2 {
root html2;
index index2.html index2.htm;
allow 192.168.10.65;
allow 192.168.10.75;
deny all;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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