title: Nginx 403 Forbidden Even After Setting The Permission
body: <p>I want to get Letsencrpyt SSL for my domain. Part of the process is, the site needs to be authorized before getting the certificate. </p>
  
  <p>I created the folder <code>./well-known</code> and ran the command I was asked to and I got;</p>
  
  <pre><code>Nginx 403 forbidden.
  </code></pre>
  
  <p>I'm on nginx/1.10.0 (Ubuntu)</p>
  
  <p>I <code>chown</code> the directory and granted it <code>755</code> yet still the same. Check out the permissions in my directory below. </p>
  
  <pre><code>namei -l /var/www/example.com/.well-known                      
  
   f: /var/www/example.com/.well-known
   drwxr-xr-x root   root /
   drwxr-xr-x root   root var
   drwxr-xr-x root   root www
   drwxr-xr-x cman sudo example.com
   drwxr-xr-x cman sudo .well-known
  </code></pre>
  
  <p>I also created a <code>working.html</code> file in the <code>/.well-known</code> folder and I load <code>example.com/.well-known/working.html</code>, I got the same 403 Forbidden.</p>
  
  <p>Nginx.conf</p>
  
  <pre><code> upstream kip_app_server {
     # fail_timeout=0 means we always retry an upstream even if it failed
     # to return a good HTTP response (in case the Gunicorn master nukes a
     # single worker for timing out).
  
      server unix:/var/www/example.com/src/run/trav.sock fail_timeout=0;
  }
  
  server {
        listen 80;
        server_name example.com www.example.com;
  
   location = /favicon.ico { access_log off; log_not_found off; }
   access_log /var/www/example.com/logs/access.log;
   error_log /var/www/example.com/logs/nerror.log;
  
   charset utf-8;
  
   client_max_body_size 75M;
  
    location /static/ {
         alias /var/www/example.com/src/static/;
     }
  
     location /media/ {
         alias var/www/example.com/src/media/;
    }
  
     location ~ /\.well-known {
         allow all;
         alias /var/www/example.com/.well-known/;
      }
  
  
      location / {
        include proxy_params;
         proxy_pass http://kip_app_server;
         #proxy_set_header X-Forwarded-Host $server_name;
        #proxy_set_header X-Real-IP $remote_addr;
     }
   }
  </code></pre>