I have Magento 2 installed on ubuntu 16.04 with nginx webserver. The site is working pretty good, then i try to enable whole site SSL from letsencrypt and I run into problems.

my root dir is /var/www/html with the magento install directly in there

I change the settings in magento so the secure url is https://example.com/ and I set nginx up as per https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04.

In sites-enabled i have

upstream fastcgi_backend {
        server  unix:/run/php/php7.0-fpm.sock; }  server {

        listen 80;
        server_name www.sxcmarket.com;
        set $MAGE_ROOT /var/www/html;
        set $MAGE_MODE developer;
        include /var/www/html/nginx.conf.sample;  }

When I do nginx -t it shows no problems. Then when i try to go to either www.example.com or example.com i get 403 error

when i check the nginx/error.log I get the following

2016/10/10 06:12:23 [error] 8335#8335: *11 directory index of "/var/www/html/" is forbidden, client: xxx.xxx.xxx.xxx, server: _, request: "GET / HTTP/2.0", host: "example.com"

Ive tried a number of different SSL setups and get the same result each time

  • could you check magento root folder user, group and their read write permission? – Bilal Usean Oct 10 '16 at 6:57
  • ls -l of html folders - drwxr-x--- 12 myuser www-data 4096 Oct 9 21:05 html root@magento:/var/www# groups myuser myuser: www-data sudo – Anthony Oct 10 '16 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.