2015-06-23 2 views
0

У меня есть два домена, fav2feed.com и elciervonegro.com на одном сервере, nginx, все настройки самостоятельно (новичок). Если я размещаю только один домен в разрешенных сайтах, они загружаются штрафом induvidually. Покупайте, когда я пытаюсь одновременно работать в Интернете, оба домена загружают 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

Это также может быть вызвано использованием идентичного fastcgi_pass 127.0.0.1:9000; в серверных блоках nginx (если скопировать одну конфигурацию домена на другой).

Если вы работаете php-fpm в chroot с различными listen ports он будет выглядеть, как будто nginx служит тот же сайт для обоих доменов.

Смежные вопросы