By Jake
Hello, I have recently deployed my Ruby on Rails application to a plain Ubuntu 16.04 droplet with Nginx, passenger & Let’s encrypt.
The rails app worked fine without Let’s encrypt but as soon as I installed it, I can’t seem to understand why it’s pointing to the “Welcome to Nginx” page instead of my rails app.
In /etc/nginx/sites-enabled/default I’ve used:
root /var/www/myapp;
root /var/www/myapp/code;
root /var/www/myapp/code/public;
This is where my application is.
Under /etc/nginx/nginx.conf I’ve tried using these:
user www-data;
user rails;
user root;
And I’ve even changed the ownership around a few times for root, rails and www-data:
sudo chown -R www-data:www-data /var/www/myapp
sudo find /var/www/myapp -type d -exec chmod 770 {} \;
sudo find /var/www/myapp -type f -exec chmod 660 {} \;
I don’t know what gives… I keep getting “403 Forbidden nginx/1.14.0” but it worked fine and launched my deployed app without Let’s Encrypt.
I would love some help, thank you!
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!
Let’s Encrypt scripts change Nginx configuration. It happened with my Nginx installation too. I just manually installed certificates, instead of running scripts.
Hello friend!
I couldn’t say with absolute authority as much of this is going to be relative to your configuration, but it sounds like the configuration for HTTP and HTTPS may not match. You might check every config file starting at nginx.conf, and then any/every directory which is included by instruction in that primary file. Something is overriding what you had before, and the good news is that it has to be somewhere close by in those configurations.
Kind Regards, Jarland
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.