2015-06-23 42 views
0

我有兩個域,fav2feed.com和elciervonegro.com在同一臺服務器上,nginx,全部由我自己設置(新手)。 如果我只將一個域放在啓用了網站的地方,它們會自動加載。當我嘗試同時在線時購買,兩個域加載elciervonegro.com。Nginx爲所有域加載相同的網絡

這裏是我的地盤,可供選擇:

fav2feed.com

server { 
listen 80; ## listen for ipv4; this line is default and implied 
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6 

root /var/www/fav2feed; 
index index.php index.html index.htm; 

# Make site accessible from http://localhost/ 
server_name fav2feed.com; 

location/{ 
    # First attempt to serve request as file, then 
    # as directory, then fall back to displaying a 404. 
    try_files $uri $uri/ /index.html; 
    # Uncomment to enable naxsi on this location 
    # include /etc/nginx/naxsi.rules 
} 


#error_page 404 /404.html; 


# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
# 
location ~ \.php$ { 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini 
# 
# # With php5-cgi alone: 
# fastcgi_pass 127.0.0.1:9000; 
# # With php5-fpm: 
    fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_index index.php; 
    include fastcgi_params; 
} 

} 


# another virtual host using mix of IP-, name-, and port-based configuration 
# 
#server { 
# listen 8000; 
# listen somename:8080; 
# server_name somename alias another.alias; 
# root html; 
# index index.html index.htm; 
# 
# location/{ 
#  try_files $uri $uri/ =404; 
# } 
#} 

elcievonegro.com

server { 
    listen 80; ## listen for ipv4; this line is default and implied 
    #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 

    root /var/www/elciervonegro; 
    index index.php index.html index.htm; 

    # Make site accessible from http://localhost/ 
    server_name elciervonegro.com; 

    location/{ 
    # First attempt to serve request as file, then 
    # as directory, then fall back to displaying a 404. 
    try_files $uri $uri/ /index.html; 
    # Uncomment to enable naxsi on this location 
    # include /etc/nginx/naxsi.rules 
    } 

    location /doc/ { 
    alias /usr/share/doc/; 
    autoindex on; 
    allow 127.0.0.1; 
    allow ::1; 
    deny all; 
    } 


    #error_page 404 /404.html; 


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
    # 
    location ~ \.php$ { 
    fastcgi_split_path_info ^(.+\.php)(/.+)$; 
    # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini 
    # 
    # # With php5-cgi alone: 
    # fastcgi_pass 127.0.0.1:9000; 
    # # With php5-fpm: 
    fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_index index.php; 
    include fastcgi_params; 
    } 

} 
+0

服務器管理,請考慮將問題遷移到[sf](或首先在那裏詢問) –

回答

0

我已經得到了通過使用從一個乾淨的模板設置開始進行修復網站上的默認文件 - 可用,否則無法修復。

由於

0

這也可以通過在服務器nginx塊使用相同的fastcgi_pass 127.0.0.1:9000;引起的(如果複製一個域配置到另一個)。

如果您在chroot不同listen ports運行php-fpm它將彷彿nginx是服務於同一個網站兩個域出現。

相關問題