Welcome to Nginx Page Displays Instead of Actual Webpage

Nginx welcome to nginx displays www. prefix; works fine without

Remove one of the server_name s.

Sample Image

Remember to nginx -s reload. The rest of your code seams fine.

Did you use certbot --nginx to get ssl for example.com or www.example.com?
Because I see both of them here.

Sample Image

If you still have the same issue, I suggest you remove the file, and also the shortcut, and start over. Once you make sure both example.com or www.example.com work correctly, then go after issuing the ssl.

And remember, you just need to get ssl for either example.com or www.example.com.

Nginx page displaying instead of home page (Digital Ocean - LEMP)

Simplify

Create a "Hello world" index.html and copy it into your project's root directory*.

Divide and conquer

My suggestion to you is to strip your nginx.conf down to a very simple form, like the one below.

server {
listen 80 default;
server_name yourdomainname.com;
root /home/your_app_name/public;

try_files $uri/index.html $uri ;

error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}

Organization

*I would recommend you not have your index.html in an nginx directory. Use as your root directory something that is specific to your project, like in the example above. Place your Hello World index page there.

Restart

Now reload NGINX and see if it is loading your simple "Hello World" index.html. If so, start to add complexity, one component at a time.

File permissions

The #1 gotcha on unix based OS is the file permissions. It's important to look at your NGINX error logs to see if you're getting pinged by user/group blocks on files and dirs. If NGINX does not have permission to read index.html, game over.


Digital Ocean calls their tools "one-click installs" and this is misleading. I have several DO VPSs setup, so I know that their installs are not by any means complete installs, as you'd expect. Going back to installing components one at a time and confirming each is working is the best method.

Nginx only shows welcome page

Missing includes in nginx.conf

include /usr/local/etc/nginx/sites-enabled/*;

http://wiki.nginx.org/CoreModule#include

Nginx: Welcome to nginx! page keeps showing

Holy ish. All that is apparently required to make it work is:

Comment out/delete the "location /" directive which is added by default during the installation:

    # location / {
# root html;
# index index.html index.htm;
# passenger_enabled on;
# }

(If anybody knows why, I'd be interested to know.)

Welcome to nginx! page keeps on showing

I might be a little late but I had the same issue and solved it by doing the following in my nginx site configuration file:

server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}


Related Topics



Leave a reply



Submit