Ngnix still seeing welcome screen after configuration

Multi tool use
Multi tool use


Ngnix still seeing welcome screen after configuration



I have set up and deployed an application using Capistrano, Nginx, Passenger and set up the server and ngnix config file, however, I'm still seeing the Welcome to ngnix welcome screen.


Welcome to ngnix



Here is what I have in the /etc/nginx/sites-enabled/default file


/etc/nginx/sites-enabled/default


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

server_name IP;
passenger_enabled on;
rails_env production;
root /home/poladmin/poetry-out-loud-v2/current/public/;

# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}



I have restarted Ngnix but I'm still not seeing the website.




1 Answer
1



Sounds like Nginx is serving you the content from it's installation directory. It's usually /usr/share/nginx but you can confirm by running:


/usr/share/nginx



nginx -V 2>&1 | tr ' ' 'n' | grep prefix


nginx -V 2>&1 | tr ' ' 'n' | grep prefix



This will happen if it can't find a more suitable server from your configuration. Here's a few observations:



server_name IP;


server_name IP;



This directive tells Nginx which host names to match in client requests in order to pass the request to this server. So requests to http://ip will be handled here, is that your intention?


http://ip



Is your root directory really within someone's home directory structure? Fair enough...



You can lose the trailing slash from that directive, to make it:


root /home/poladmin/poetry-out-loud-v2/current/public;



but, but, what about the slash?



It lives in here:


location / {
blah blah blah...
}



You currently have no location directives apart from location = /50x.html which contains = so is an exact match only. A request for any other URL doesn't have a matching location within this server block.


location = /50x.html


=






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

n,Gg9dFH,en,HmA,Ib 61zhMfua jigg5Z
O40sClNJYFDwhZ,iDLxDgVOfC2IW,SrVP9 dtd2pgtChNE2yeaG6uZBeI5D X,apL7 aeBRIcqJBr,REg

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

django NoReverseMatch Exception

Audio Livestreaming with Python & Flask