Receiving a '403 Forbidden' error after successful Ghost installation


#1

Hi there,

I’m receiving a 403 error when trying to visit my website after successfully installing Ghost. I’m assuming there may be some configuration error, however when I try and serve HTML/PHP content, it works absolutely fine.

URL: https://wallo.ws
Ghost Version: 2.1.0
Config: LEMP stack on Ubuntu 18.04 (with LetsEncrypt already setup for the domain)
Tested on Chrome/Firefox

Server Block Configuration for the domain:

server {

root /var/www/wallo.ws;

index index.php index.html index.htm index.nginx-debian.html;

server_name wallo.ws www.wallo.ws;

location / {
try_files $uri uri/ =404; } location ~ \.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wallo.ws/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wallo.ws/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = www.wallo.ws) {
return 301 https://$host$request_uri;
} # managed by Certbot

if ($host = wallo.ws) {
    return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
listen [::]:80;

server_name wallo.ws www.wallo.ws;
return 404; # managed by Certbot

}

And here is my Ghost Nginx config file:

server {
listen 80;
listen [::]:80;

server_name wallo.ws;
root /var/www/wallo.ws/system/nginx-root;

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2368;
    
}

location ~ /.well-known {
    allow all;
}

client_max_body_size 50m;

}

And here is the last entry from my nginx error log:

2018/09/05 19:34:21 [error] 24190#24190: *4328 directory index of “/var/www/wallo.ws/” is forbidden, client: 64.71.168.196, server: wallo.ws, request: “GET / HTTP/1.1”, host : “wallo.ws”

What could be the issue that’s causing this 403 error? Any help at all would be appreciated, thank you!


#2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.