# Nginx seems to just be serving default page

**URL:** <https://www.ruby-forum.com/t/nginx-seems-to-just-be-serving-default-page/244318>\
**Category:** NGINX\
**Created:** [March 21, 2016, 6:51pm UTC](https://www.ruby-forum.com/t/nginx-seems-to-just-be-serving-default-page/244318 "2016-03-21T18:51:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [March 21, 2016, 6:51pm UTC](https://www.ruby-forum.com/t/nginx-seems-to-just-be-serving-default-page/244318/1 "2016-03-21T18:51:45Z")

</div>

I am brand new to nginx and have it running on a VM  
([mynginx.example.com](http://mynginx.example.com))  
and running. I am trying to get it to serve content under /opt/mysite  
(where  
the homepage is located at /opt/mysite/index.html).

Below is the nginx.conf that I’m using:

```
user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
    worker_connections 768;
}

http {
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    gzip on;
    gzip_disable "msie6";

    server {
        listen 80;
        server_name mynginx.example.com;

        location / {
            root /opt/mysite;
            index index.html index.htm;
        }

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
            root html;
        }
    }

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    include servers/*;
}

```

With this configuration, going to both [http://mynginx.example.com](http://mynginx.example.com) and  
[http://mynginx.example.com/index.html](http://mynginx.example.com/index.html) have the exact same effect: they  
take  
you to the default nginx page ( **Welcome to nginx!** )…

Can anybody spot why?

Posted at Nginx Forum:

> **[nginx seems to just be serving default page](https://forum.nginx.org/read.php?2,265548,265548#msg-265548)**
>
> I am brand new to nginx and have it running on a VM (mynginx.example.com) and running. I am trying to get it to serve content under /opt/mysite (where the homepage is located at /opt/mysite/index.html). Below is the nginx.conf that I'm using: user...

---

<div class="post-metadata">

**Author:** ![zharvey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/919ad9/32.png) [@zharvey](https://www.ruby-forum.com/u/zharvey)\
**Post date:** [March 21, 2016, 6:52pm UTC](https://www.ruby-forum.com/t/nginx-seems-to-just-be-serving-default-page/244318/2 "2016-03-21T18:52:56Z")

</div>

As a followup to the original question, what I’m really looking for is  
for  
my homepage (index.html) to be served when you go to  
[http://mynginx.example.com](http://mynginx.example.com), _not_ the nginx default page.

Posted at Nginx Forum:

> **[Re: nginx seems to just be serving default page](https://forum.nginx.org/read.php?2,265548,265549#msg-265549)**
>
> I am brand new to nginx and have it running on a VM (mynginx.example.com) and running. I am trying to get it to serve content under /opt/mysite (where the homepage is located at /opt/mysite/index.html). Below is the nginx.conf that I'm using: user...

---

<div class="post-metadata">

**Author:** ![zharvey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/919ad9/32.png) [@zharvey](https://www.ruby-forum.com/u/zharvey)\
**Post date:** [March 22, 2016, 1:25am UTC](https://www.ruby-forum.com/t/nginx-seems-to-just-be-serving-default-page/244318/3 "2016-03-22T01:25:28Z")

</div>

Have you checked your configuration has been loaded properly?

Most probably, either:

- your configuration is not loaded: check it with the -t nginx option,  
then  
check your error log on reload to spot any message there
- your configuration file is not used, the default one is (you might  
ensure  
you overwrote the right file or use the -c nginx option to specify your  
configuration file). If you are using nginx \>=1.9.2, you might wanna  
check  
the new -T option so the loaded configuration is dumped on standard  
output

* * *

_B. R._

On Mon, Mar 21, 2016 at 6:52 PM, zharvey [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
