Nginx 多个服务器块在mobile中仅加载1个服务器块
我正在nginx可用站点中创建服务器块。我有2个服务器名,如果访问浏览器,它可以正常工作,但在移动设备中,它将显示I.p地址,并将加载第一个应用程序,我无法加载我的第二个应用程序,因为如果我拨入url mysecondsubdomain.mydomain.com,它将重定向到I.p地址,第一个应用程序将被服务。。我不知道它为什么会这样 更新:我注意到,在浏览器中输入mysecondsubdomain.mydomain.com几个小时后,我将被重定向到I.p地址,它将为我的第一个应用提供服务Nginx 多个服务器块在mobile中仅加载1个服务器块,nginx,dns,virtualhost,ubuntu-16.04,Nginx,Dns,Virtualhost,Ubuntu 16.04,我正在nginx可用站点中创建服务器块。我有2个服务器名,如果访问浏览器,它可以正常工作,但在移动设备中,它将显示I.p地址,并将加载第一个应用程序,我无法加载我的第二个应用程序,因为如果我拨入url mysecondsubdomain.mydomain.com,它将重定向到I.p地址,第一个应用程序将被服务。。我不知道它为什么会这样 更新:我注意到,在浏览器中输入mysecondsubdomain.mydomain.com几个小时后,我将被重定向到I.p地址,它将为我的第一个应用提供服务 se
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/banking/public/;
index index.php index.html index.htm;
server_name banking.mydomain.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
listen [::]:80;
root /var/www/inventory/public/;
index index.php index.html index.htm;
server_name inventory.mydomain.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}