mishfaq
By:
mishfaq

403 Forbidden error

October 9, 2017 91 views
Nginx WordPress Ubuntu 16.04

403 Forbidden error when visiting subdomain.example.com.

For the last few days I have been trying to setup a subdomain on my Nginx server for my website, the main website in the /var/www/html dictionary is working fine but can't figure out the subdomain and example.com/forum ( with vanilla forum files are in the /var/www/html with my main domain name and have not made any changes to the config for forum when trying to install vanilla it goes to http://localhost/forum/dashboard/setup page rather than www.example.com/forum and setup link) if there is anything I need to change in the default config file for the forum please advise.

Regarding the subdomain.example.com I have setup a server with below config and have copied it to sites-enabled as well as sites-available but it still returns 403 error as mention above however when I place an a index.html file in the dictionary it loads fine but doesn't work with WordPress files. Thanks in advance for any answers/help


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

        root /var/www/uk.watchallchannels.com/html;
        index index.html index.htm index.nginx-debian.html;

        server_name uk.watchallchannels.com;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }


        location = /favicon.ico { log_not_found off; access_log off; }
        location = /robots.txt { log_not_found off; access_log off; allow all; }
        location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
            expires max;
            log_not_found off;
        }
}

1 comment
Be the first one to answer this question.