Answer the question
In order to leave comments, you need to log in
Why do all domains serve content from one site (nginx+php-fpm)?
I am studying linux administration, I have a question about basic settings, but I did not find a single article that solves my problem.
I configured site1.ru for the first domain without any problems. I installed phpmyadmin, but when I go to {server ip}/phpmyadmn, it gives site1.ru. I postponed
this question, connected site2.ru, but at site2.ru it also gives content from site1.ru.
Configs in the pool /etc/php/7.2/fpm/pool.d/site1.ru.conf:
[site1]
user = site1.ru
group = site1.ru
listen = /var/run/php5-fpm-site1.ru.sock
listen.owner = www-data
listen.group = www-data
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
server {
listen 80 default_server;
root /var/www/8991.ru/public_html/;
index index.php index.html index.htm;
server_name 8991.ru www.8991.ru;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm-site1.sock;
include snippets/fastcgi-php.conf;
}
}
Answer the question
In order to leave comments, you need to log in
Remove default_server from the config of the second site. In general, it is better to leave the default site only by SP, not even a site, but a stub.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question