Home  >  Q&A  >  body text

Unable to access after changing server_name in nginx?

I pointed the two domain names to the same folder before
Now I want to point www.test2.com to another folder
But after the change, domain names such as www.test2.com and xy.test2.com cannot be accessed ,
can be replaced with other domain names such as www.test3.com.
I really can’t find the reason, please ask God for an answer

给我你的怀抱给我你的怀抱2713 days ago525

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-16 17:21:57

    When you pointed to another directory, did you remove test2.com from server_name in the original server?
    Configuration problems can be tested through nginx -t, and the problems in the test file will be displayed.
    In addition, if there is a problem with the configuration file, a response error should be printed when starting, please check it carefully.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 17:21:57

    That means the changes do not take effect. Clear the nginx cache, usually in var/cache/nginx. Or turn off sendfile in the configuration, especially when running on virtualbox. Reference from http://stackoverflow.com/questions/6236078/how-to-clear-the-cache-of-nginx

    reply
    0
  • Cancelreply