Home > OS >  Nginx. Conf to delete a domain name, then can access
Nginx. Conf to delete a domain name, then can access

Time:11-25

Server {
Listen, 80;
Server_name t.abc.com;
Rewrite ^/(. *) ${variant} http://$/$1;
#charset koi8-r;

#access_log logs/host.access.log main;

The location/{
The root HTML;
The index index. HTML index. HTM;
}
}

Before server_name t.abc.com t.efg.com
Before it is written, binding the two domain names, delete it now, but found that t.efg.com can still visit
Nginx restart and reload all did, or doesn't work,
In wonder

CodePudding user response:

To add a server section, as the default site
 server {
80 default_server listen;
Server_name _;
The return of 403;
}

CodePudding user response:

It is ok to add a default site, you two domain is pointing to the IP at the same time

CodePudding user response:

refer to the second floor hc_net response:
add a default site is ok, you two domain is pointing to the IP at the same time

I am not going to default access, it is the original 80 port bind the two domain name, now removed, can also access the deleted, bizarre,
The two domain is pointing to the same IP,

CodePudding user response:

Domain name resolution to delete, such as dnspod

CodePudding user response:

reference 4 floor emperor royal thunder response:
DNS deleted, such as dnspod

Domain name resolution is not deleted, but can't delete access what is truth?

CodePudding user response:

No match, the default selection first server_name, can add a test to see

CodePudding user response:

reference xyq1986 reply: 3/f
Quote: refer to the second floor hc_net response:

It is ok to add a default site, you two domain is pointing to the IP at the same time

I am not going to default access, it is the original 80 port bind the two domain name, now removed, can also access the deleted, bizarre,
The two domain is pointing to the same IP,


The server your site should be the extra yourself, if you do not match, will own server site default access itself, is also a port 80,
Because you this a few site access to the same page (Nginx website, for example), and in fact have access to delete domain, how to verify?
Will you set up a site specified visit another page, don't delete access, access is Nginx page again after deletion, a try,

CodePudding user response:

You must delete the cache the client domain name, because t.efg.com after the success of the resolution, can be in local cache its IP, access to local DNS will parse the domain directly into the IP, nginx configuration has nothing to do with you,

CodePudding user response:

Finally solved a problem, how to solve
  • Related