如何在一个端口和一个服务器块设置nginx与不同的域

我有

server { listen 80; server_name domain1 domain2 domain3 location / { proxy_pass http://127.0.0.1:8088; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 120; proxy_send_timeout 120; proxy_read_timeout 180; } } server { listen domainX:80; server_name domainX www.domainX location / { proxy_pass http://127.0.0.1:8088; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 120; proxy_send_timeout 120; proxy_read_timeout 180; } location ~* \.(jpeg|jpg|gif|png|ico|bmp|swf|css|js)$ { root domainXStaticRoot } # other options for domainX only } 

对于来自第一个服务器块的域,nginx只返回根页面:

 http://domain1 -> returns root page for domain1 http://domain1/style.css -> nginx trying return according location from server block two eg domainXStaticRoot/style.css 

如果修改听80; 听domain1:80; 那么对于域1所有工作正常,但我没有发现如何写入多个域的侦听指令。

我的错误在哪里?