Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Unable to display static content on same server

$
0
0
Hi,

I am newbie to Nginx and has been asked to do the following. My company has a new website underway and they would like to register the new site in our DNS (netscaler) and display an "under construction" message if someone visits the page. My network guys have registered the name in DNS and redirects www.example.com to my windows Nginx server. On Nginx I have added this to my config and restarted Nginx:

server {
listen 80;
server_name www.example.com;
location / {
root D:\wwwroot;
}
}

On the Nginx server I have added a folder wwwroot on my D drive and placed a file called index.html (just a simple Word document containing the under construction message and saved it as .html)

When I try to visit www.example.com in my browser it fails to load my index.html and all I see is a Http/1.1 Service Unavailable message

For testing purposes I have tried to add this to an already working domain of ours and then it works?! What I did to get this to work is the following.

In Nginx config:

server {
listen 80;
server_name www.workingdomain.com;
location /test {
root D:\wwwroot;
}
}

On Nginx D drive:

Inside "wwwroot" folder I placed a folder called "test" and put my index.html there. All works fine?!

Any suggestions as to why it does not work without a location set?

Cheers
thg

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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