Welcome! Log In Create A New Profile


problem with setting Virtual Hosts

March 23, 2011 01:16PM
i need help :(

I wrote as the following site.


here is my nginx.conf

user www www;
worker_processes 1;
error_log /data/logs/nginx_error.log crit;
pid /opt/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
use epoll;
worker_connections 65535;
include mime.types;
default_type application/octet-stream;

#charset gb2312;

server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;

sendfile on;
tcp_nopush on;

keepalive_timeout 60;

tcp_nodelay on;

fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;

gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
server {
listen 80 default;
server_name _;
access_log logs/default.access.log;

server_name_in_redirect off;

root /data/www;
#limit_zone crawler $binary_remote_addr 10m;
server {
# Replace this port with the right one for your requirements
listen 80; #could also be

# Multiple hostnames separated by spaces. Replace these as well.
server_name star.domain.com *.domain.com; # Alternately: _

root /data/www/$host/;

error_page 404 errors/404.html;
access_log logs/star.domain.com.access.log;

index index.php index.html index.htm;

# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;

location ~ \.php$ {
fastcgi_intercept_errors on;
# By all means use a different server for the fcgi processes if you need to

location ~ /\.ht {
deny all;


when i vist a.domain.com

but the website redirect to the following site.

Subject Author Posted

problem with setting Virtual Hosts

chatfeed March 23, 2011 01:16PM

Re: problem with setting Virtual Hosts

Francis Daly March 23, 2011 02:10PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
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