Welcome! Log In Create A New Profile

Advanced

Re: how to add virtualhosts in nginx?

September 22, 2010 02:36PM
Hola António and everybody,

Thanks for the help, I really apreciate it!

The VirtualHosts configuration file is located in:
/etc/nginx/conf.d/virtual.conf

example:

http {
### vhost1 - www.prueba.com ###
server {
listen 80;
server_name www.prueba.com;
access_log logs/prueba.access.log main;

index index.html;
root /var/www/virtuales/prueba.com/htdocs;
}



2010/09/22 13:21:22 [info] 24429#0: the configuration file
/etc/nginx/nginx.conf syntax is ok
2010/09/22 13:21:22 [emerg] 24429#0: open()
"/usr/share/nginx/logs/prueba.access.log" failed (2: No such file or
directory)
2010/09/22 13:21:22 [emerg] 24429#0: the configuration file
/etc/nginx/nginx.conf test failed

¿the logs file must be created maually everytime I create a domain?

I remove the "access_log logs/prueba.access.log main;" line and works,
but when I browse "www.prueba.com" I get nginx default html page, and when I
browse "www.prueba.com/index.html" the index.html placed in
/var/www/virtuales/prueba.com/html is showed.

is possible show index.html directly when "prueba.com" or "www.prueba.com"
is entered in the browser?

Maybe some redirection in the VirtualHost configuration file

what about the error logs files?

Thank you very much!

2010/9/22 António P. P. Almeida <appa@perusio.net>

> On 22 Set 2010 07h21 WEST, marceloramone@gmail.com wrote:
>
> > Thank you António,
> >
> > I saw this example before.
> >
> > I saw many examples, but does not work.
> >
> > I get always nginx default html page or 404...
>
> Then there's something wrong with your configuration. Perhaps the root
> directive or a/the location block. This is guessing. It's much better
> if you place the config here, so that we can help you debug it.
>
> --- appa
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



--
¿Por qué sufrimos? http://www.youtube.comwatch?v=FK53c2jW2VU
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

how to add virtualhosts in nginx?

pirulo September 22, 2010 01:50AM

Re: how to add virtualhosts in nginx?

António P. P. Almeida September 22, 2010 02:04AM

Re: how to add virtualhosts in nginx?

pirulo September 22, 2010 02:24AM

Re: how to add virtualhosts in nginx?

António P. P. Almeida September 22, 2010 03:18AM

Re: how to add virtualhosts in nginx?

pirulo September 22, 2010 02:36PM

Re: how to add virtualhosts in nginx?

António P. P. Almeida September 22, 2010 03:42PM

Re: how to add virtualhosts in nginx?

Cedric Jeanneret September 23, 2010 01:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready