Nginx seems to just be serving default page

I am brand new to nginx and have it running on a VM
and running. I am trying to get it to serve content under /opt/mysite
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/;

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;

        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 and have the exact same effect: they
you to the default nginx page (Welcome to nginx!)…

Can anybody spot why?

Posted at Nginx Forum:

As a followup to the original question, what I’m really looking for is
my homepage (index.html) to be served when you go to, not the nginx default page.

Posted at Nginx Forum:

Have you checked your configuration has been loaded properly?

Most probably, either:

  • your configuration is not loaded: check it with the -t nginx option,
    check your error log on reload to spot any message there
  • your configuration file is not used, the default one is (you might
    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
    the new -T option so the loaded configuration is dumped on standard

B. R.

On Mon, Mar 21, 2016 at 6:52 PM, zharvey [email protected]