Report this

What is the reason for this report?

nginx server shows 403 error: directory index of > “/home/deploy/my_app/current/public/” is forbidden

Posted on January 12, 2021

Everything was working fine earlier. I got message on Digital Ocean server and so upgraded a few packages on droplet (Ubuntu 18.04 LTS). Since then the site is broken and I get 403 error.

I have restarted nginx several times. Also reinstalled Rails application. I am a newbie. Any help to resolve this 403 error is greatly appreciated.

/etc/nginx/sites-available/default file is as follows:

server {
        listen 80;
        listen [::]:80;
        server_name *.myserver.com;
        return 301 https://$host$request_uri;
}
server {
        listen 443 ssl http2;
        server_name *.myserver.com;
        passenger_enabled on;
        rails_env    production;
        root         /home/deploy/my_app/current/public;
        ssl_certificate /home/deploy/letsencrypt/fullchain.pem;
        ssl_certificate_key /home/deploy/letsencrypt/privkey.pem;

        # redirect server error pages to the static page /50x.html

}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.