Nginx page displaying instead of home page

Whenever I enter the IP address of my site, I get this page:

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to Commercial support is available at

Thank you for using nginx.

I have searched for answers, but have not found anything that works for me. I am running Ubuntu LEMP on 14.04, and used the one-click installation. The only thing I have done so far is to add a folder in the main directory, and call it “public.” This is where I will put my folders/pages etc.

Because of this change, I would like to set up the “public” folder as the root folder of my site, so that it will look there for an “index.***” page when displaying to a user. I changed the “etc/nginx/available-sites/default.conf” file to hopefully accomodate this:

server {
	listen 80 default_server;
	listen [::]:80 default_server ipv6only=on;

	root /public/;
	index index.php index.html index.htm;

	# Make site accessible from http://localhost/
	server_name localhost;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
		# Uncomment to enable naxsi on this location
		# include /etc/nginx/naxsi.rules

	error_page 404 /404.html;
	error_page 500 502 503 504 /50x.html;
	location = /50x.html {
		root /usr/share/nginx/html;

	location ~ \.php$ {
		try_files $uri =404;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_pass unix:/var/run/php5-fpm.sock;
		fastcgi_index index.php;
		include fastcgi_params;



However, I am still only getting the Nginx welcome page when I access my site by IP, and it is getting annoying. How can I show the home page?

Let me know if I need to add anything else. Thanks!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

go to nginx.conf and comment out ‘server’ block because it overrides any other configuration placed in conf.d or default,conf

I could not get the default welcome page to go away until I removed the default config and then made a new one with this signature:

upstream myproject { server; }

server { listen 80; location / { proxy_pass http://myproject; } }

Voila, my life got better.

configure you host file from the root level. This error may be permission issue. i have fix my issue by configuring host file from root level.