I have something to ask, I have account in go daddy and we have register the main domain in go daddy…now I also purchase in GCE google cloud computing engine…and I host all my web application…I set subdomain in go daddy the DNS and pointing to the i.p address of my GCE, in my GCE i set up server-block or equivalent to virtual host…my problem is that when I access it on mobile the subdomain it will not hit the page or the subdomain I want to load…it always the first subdomain, instead I hit the secondsubdomain. also it will display i.p adress intead subdomain name. why it alwasy i.p adress if I viewed in mobile…sometimes in desktop too.
here is my configuration nginx.
firstsubdomain
server {
listen 80 ;
root /var/www/project1/public/;
index index.php index.html index.htm;
server_name firstproj.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;
}
}
second subdomain
server {
listen 80 ;
root /var/www/project2/public/;
index index.php index.html index.htm;
server_name secondproj.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;
}
}