Welcome! Log In Create A New Profile

Advanced

nginx seems to just be serving default page

March 21, 2016 01:51PM
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 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 and 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?
Subject Author Posted

nginx seems to just be serving default page

zharvey March 21, 2016 01:51PM

Re: nginx seems to just be serving default page

zharvey March 21, 2016 01:52PM

Re: nginx seems to just be serving default page

B.R. March 21, 2016 08:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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