How to properly configure virtual host on nginx?
I have my domain pointed to my dedicated server
I have configured files in /etc/nginx/sites-available/domain1.com
content of domain1.com is:
Code:
server {
server_name www.domain1.com domain1.com;
root /var/www/domain1.com;
access_log /var/log/nginx/domain1.com.access.log;
index index.html index.php index.htm;
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
location ~ /\.ht {
deny all;
}
}
I have created symlink to sites-available using ln -s command
my default.conf of nginx points to
root /usr/share/nginx/html
I create all with root access, www folder has root ownership and group own, same /www/domain1.com folder,
domain1.com has privilages drwxr-xr-x
I have phpbb forums files (installed) when I enter domain1.com it displays 403 forbidden ..
On apache2 it works fine
Any Idea what is wrong ? why this doesnt work?