i have a issue with virtual host

Olivier Morel oliviermo75 at gmail.com
Thu Nov 8 13:37:50 UTC 2012


hy everybody
I try to create a virtual host (server block) on nginx, and i have two
issue.

When i m going to* http://localhost* ,i see my website
But when i try to go to the virtual host (server block) *
http://localhost/websvn*
I get an error because he try to find a webpage  with the name *websvn* on
my first website.
I don't understand why ??

*/conf/nginx.conf*

http {
>      include       mime.types;
>     passenger_root
> /usr/local/centOs/rvm/gems/ruby-1.9.3-p125/gems/passenger-3.0.11;  # it's
> for Ruby on Rails
>     passenger_ruby
> /usr/local/centOs/rvm/bin/ruby-1.9.3-p125;
> # it's for Ruby on Rails
>     passenger_max_pool_size 10;
>                                       # it's for Ruby on Rails
>
>     default_type  application/octet-stream;
>
>     sendfile        on;
> ## TCP options
>     tcp_nopush     on;
>     tcp_nodelay    on;
> ## Timeout
>     keepalive_timeout  65;
>
>     types_hash_max_size 2048;
>     server_names_hash_bucket_size 128;
>     proxy_cache_path /mnt/donner/nginx/cache levels=1:2 keys_zone=one:10m;
>     gzip  on;
>     server_tokens off;
>
> # =======add server block ====== ##
>
>      include /usr/local/centOs/nginx/vhosts-available/*;
>      include /usr/local/centOs/nginx/vhosts-available/*.conf;
>
>
>  server {
>         listen       80;
>         #server_name localhost;
>         passenger_enabled on;
>         passenger_use_global_queue on;
>
>         error_log   /home/logs/nginx/error.log;
>         access_log  /home/logs/nginx/access-global.log;
>
      }

 }
>

*/vhost-enable/srv-websvn.conf*


server {

            listen   80;
            server_name  srv-websvn;
           # rewrite ^/(.*) http://localhost/$1 permanent;

            error_log  /home/logs/websvn/error.log;
            access_log /home/logs/websvn/access.log;
           }

server {

            listen   80;
            server_name  srv-websvn;

            error_log  /home/logs/websvn/error.log;
            access_log /home/logs/websvn/access.log;
 location / {

                  root   /home/sites_web/websvn/;
                  index  index.html;
                  #try_files $uri $uri/ /index.html;

             }
           }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121108/e1a89833/attachment.html>


More information about the nginx mailing list