I am trying to get a Sinatra app running on a Digital Ocean droplet.
I have started the Sinatra app running in var/www/myapp.com.
I have confirmed thin is running with pgrep -l -f thin.
When I navigate to myapp.com, the server presents the default "Welcome to nginx!" page.
I understand I need to configure a server block and place it in /etc/nginx/sites-available/.
There are two files in this directory: default and myapp.com
myapp.com looks like this:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/myapp.com/;
server_name myapp.com www.myapp.com;
location / {
prox_pass http://myapp.com:4567;
}
}
What additional steps do I need to take to server the sinatra site? Have I missed a step? Done anything wrong?
Friend , you can delete all configuration in /etc/nginx/sites-enabled/
Go to your nginx.conf (/etc/nginx/nginx.conf and add the following code in conf :
now go to /etc/nginx/conf.d/
and create your new .conf with example name with
nano:then write your conf :
and do
CTL+Xto save your config andquiteasy just do restart byservice nginx restartorsystemctl restart nginxYour website should be probably online and no need to have
/etc/nginx/sites-enableconfig even