Add domain to Nginx config
<p>here is my problem</p>

<p>I have domain "example.com" and i wanna that domain to be associated with folder /var/www/html/example.com</p>

<p>I've create file with name "example.com" in /etc/nginx/sites-available</p>

<pre><code>server {
    server_name http://example.com;

    root /var/www/html/example.com;
    index index.html index.php;

    # set expiration of assets to MAX for caching
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
            expires max;
            log_not_found off;
    }

    location / {
            # Check if a file or directory index file exists, else route it to index.php.
            try_files $uri $uri/ /index.php;
    }

    location ~* \.php$ {
            fastcgi_pass 127.0.0.1:9000;
            include fastcgi.conf;
    }
</code></pre>

<p>And here is my default file on /etc/nginx/sites-enabled</p>

<pre><code>server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name 188.226.145.195;

    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
    }

    location /example.com/ {
            try_files $uri $uri/ /example.com/index.php;
    }
</code></pre>

<p>I know the problem is in that root /var/www/html but cant resolve it </p>

<p>Error log:</p>

<pre><code>2016/02/27 13:53:53 [error] 10139#0: *11 directory index of "/var/www/html/" is forbidden, client: xxx.xx.xx.xx, server: 188.226.145.195, request: "GET / HTTP/1.1", host: "www.example.com"
</code></pre>

<p>Hope this is enough information so some1 can help.
Thanks.</p>