<div dir="ltr">It's important that the right access is set for the files and folders in /var/www/testdomain.ovh/web.<div><br></div><div>Nginx is running as user www-data (per default) and folders needs to be set with (at least) execute and read permissions for www-data. For files read permission is the least required.</div><div><br></div><div>~sjums<br><br><div class="gmail_quote">On Sat, Mar 7, 2015 at 1:01 PM JACK LINKERS <<a href="mailto:jacklinkers@gmail.com">jacklinkers@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi I can't access my domain after installing nginx and coinfigurong the default server conf file :<div><div><br></div><div><br><div><div># You may add here your</div><div># server {</div><div>#<span style="white-space:pre-wrap">        </span>...</div><div># }</div><div># statements for each of your virtual hosts to this file</div><div><br></div><div>##</div><div># You should look at the following URL's in order to grasp a solid understanding</div><div># of Nginx configuration files in order to fully unleash the power of Nginx.</div><div># <a href="http://wiki.nginx.org/Pitfalls" target="_blank">http://wiki.nginx.org/Pitfalls</a></div><div># <a href="http://wiki.nginx.org/QuickStart" target="_blank">http://wiki.nginx.org/QuickStart</a></div><div># <a href="http://wiki.nginx.org/Configuration" target="_blank">http://wiki.nginx.org/Configuration</a></div><div>#</div><div># Generally, you will want to move this file somewhere, and start with a clean</div><div># file but keep this around for reference. Or just disable in sites-enabled.</div><div>#</div><div># Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.</div><div>##</div><div><br></div><div>server {</div><div><span style="white-space:pre-wrap">        </span>listen 80;</div><div><span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap"> </span>server_name www.testmydomain.ovh *.testmydomain.ovh;</div><div><span style="white-space:pre-wrap">     </span>root /var/www/testmydomain.ovh/web;</div><div>        access_log /var/www/logs/testmydomain.ovh.access.log;</div><div>        error_log /var/www/logs/testmydomain.ovh.error.log;</div><div><br></div><div><span style="white-space:pre-wrap">       </span>index index.php index.html index.htm;</div><div><br></div><div><span style="white-space:pre-wrap">   </span>location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {</div><div>    <span style="white-space:pre-wrap">  </span>access_log off;</div><div>    <span style="white-space:pre-wrap">      </span>expires max;</div><div>  <span style="white-space:pre-wrap">   </span>}</div><div><br></div><div><span style="white-space:pre-wrap">       </span>location ~ \.php$ {</div><div>    <span style="white-space:pre-wrap">  </span>include fastcgi_params;</div><div>    <span style="white-space:pre-wrap">      </span>fastcgi_intercept_errors on;</div><div>    <span style="white-space:pre-wrap"> </span># By all means use a different server for the fcgi processes if you need to</div><div>    <span style="white-space:pre-wrap">  </span>fastcgi_pass unix:/var/run/php5-fpm.sock;</div><div>  <span style="white-space:pre-wrap">      </span>}</div><div>}</div><div><br></div><div>server {</div><div><span style="white-space:pre-wrap">        </span>listen 80 default_server;</div><div><span style="white-space:pre-wrap">        </span>listen [::]:80 default_server ipv6only=on;</div><div><br></div><div><span style="white-space:pre-wrap">      </span>root /usr/share/nginx/html;</div><div><span style="white-space:pre-wrap">      </span>index index.html index.htm;</div><div><br></div><div><span style="white-space:pre-wrap">     </span># Make site accessible from <a href="http://localhost/" target="_blank">http://localhost/</a></div><div><span style="white-space:pre-wrap">    </span>server_name localhost;</div><div><br></div><div><span style="white-space:pre-wrap">  </span>location / {</div><div><span style="white-space:pre-wrap">             </span># First attempt to serve request as file, then</div><div><span style="white-space:pre-wrap">           </span># as directory, then fall back to displaying a 404.</div><div><span style="white-space:pre-wrap">              </span>try_files $uri $uri/ =404;</div><div><span style="white-space:pre-wrap">               </span># Uncomment to enable naxsi on this location</div><div><span style="white-space:pre-wrap">             </span># include /etc/nginx/naxsi.rules;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">       </span>#error_page 404 /404.html;</div><div><br></div><div><span style="white-space:pre-wrap">      </span># redirect server error pages to the static page /50x.html</div><div><span style="white-space:pre-wrap">       </span>#</div><div><span style="white-space:pre-wrap">        </span>#error_page 500 502 503 504 /50x.html;</div><div><span style="white-space:pre-wrap">   </span>#location = /50x.html {</div><div><span style="white-space:pre-wrap">  </span>#<span style="white-space:pre-wrap">       </span>root /usr/share/nginx/html;</div><div><span style="white-space:pre-wrap">      </span>#}</div><div><br></div><div><span style="white-space:pre-wrap">      </span># pass the PHP scripts to FastCGI server listening on <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a></div><div><span style="white-space:pre-wrap"> </span>#</div><div><span style="white-space:pre-wrap">        </span>#location ~ \.php$ {</div><div><span style="white-space:pre-wrap">     </span>#<span style="white-space:pre-wrap">       </span>fastcgi_split_path_info ^(.+\.php)(/.+)$;</div><div><span style="white-space:pre-wrap">        </span>#<span style="white-space:pre-wrap">       </span># NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini</div><div><span style="white-space:pre-wrap">     </span>#</div><div><span style="white-space:pre-wrap">        </span>#<span style="white-space:pre-wrap">       </span># With php5-cgi alone:</div><div><span style="white-space:pre-wrap">   </span>#<span style="white-space:pre-wrap">       </span>fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;</div><div><span style="white-space:pre-wrap"> </span>#<span style="white-space:pre-wrap">       </span># With php5-fpm:</div><div><span style="white-space:pre-wrap"> </span>#<span style="white-space:pre-wrap">       </span>fastcgi_pass unix:/var/run/php5-fpm.sock;</div><div><span style="white-space:pre-wrap">        </span>#<span style="white-space:pre-wrap">       </span>fastcgi_index index.php;</div><div><span style="white-space:pre-wrap"> </span>#<span style="white-space:pre-wrap">       </span>include fastcgi_params;</div><div><span style="white-space:pre-wrap">  </span>#}</div><div><br></div><div><span style="white-space:pre-wrap">      </span># deny access to .htaccess files, if Apache's document root</div><div><span style="white-space:pre-wrap">  </span># concurs with nginx's one</div><div><span style="white-space:pre-wrap">   </span>#</div><div><span style="white-space:pre-wrap">        </span>#location ~ /\.ht {</div><div><span style="white-space:pre-wrap">      </span>#<span style="white-space:pre-wrap">       </span>deny all;</div><div><span style="white-space:pre-wrap">        </span>#}</div><div>}</div><div><br></div><div># another virtual host using mix of IP-, name-, and port-based configuration</div><div>#</div><div>#server {</div><div>#<span style="white-space:pre-wrap">  </span>listen 8000;</div><div>#<span style="white-space:pre-wrap">    </span>listen somename:8080;</div><div>#<span style="white-space:pre-wrap">   </span>server_name somename alias another.alias;</div><div>#<span style="white-space:pre-wrap">       </span>root html;</div><div>#<span style="white-space:pre-wrap">      </span>index index.html index.htm;</div><div>#</div><div>#<span style="white-space:pre-wrap">     </span>location / {</div><div>#<span style="white-space:pre-wrap">            </span>try_files $uri $uri/ =404;</div><div>#<span style="white-space:pre-wrap">      </span>}</div><div>#}</div><div><br></div><div><br></div><div># HTTPS server</div><div>#</div><div>#server {</div><div>#<span style="white-space:pre-wrap">       </span>listen 443;</div><div>#<span style="white-space:pre-wrap">     </span>server_name localhost;</div><div>#</div><div>#<span style="white-space:pre-wrap">  </span>root html;</div><div>#<span style="white-space:pre-wrap">      </span>index index.html index.htm;</div><div>#</div><div>#<span style="white-space:pre-wrap">     </span>ssl on;</div><div>#<span style="white-space:pre-wrap"> </span>ssl_certificate cert.pem;</div><div>#<span style="white-space:pre-wrap">       </span>ssl_certificate_key cert.key;</div><div>#</div><div>#<span style="white-space:pre-wrap">   </span>ssl_session_timeout 5m;</div><div>#</div><div>#<span style="white-space:pre-wrap"> </span>ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;</div><div>#<span style="white-space:pre-wrap">      </span>ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";</div><div>#<span style="white-space:pre-wrap">     </span>ssl_prefer_server_ciphers on;</div><div>#</div><div>#<span style="white-space:pre-wrap">   </span>location / {</div><div>#<span style="white-space:pre-wrap">            </span>try_files $uri $uri/ =404;</div><div>#<span style="white-space:pre-wrap">      </span>}</div><div>#}</div></div></div><div><br></div><div>What did I miss here ?</div><div><br></div></div></div>
______________________________<u></u>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/<u></u>mailman/listinfo/nginx</a></blockquote></div></div></div>