Question

Nginx redirect me to a real site web not my virtual site

  • Posted March 18, 2021
  • Nginx

Hi , it te first time that i use nginx ! so i’m asking why if i add a virtual domain name in /etc/host for exemple 192.168.2.1 exemple.com www.exemple.com and i follow this tuto https://vexxhost.com/resources/tutorials/how-to-set-up-nginx-virtual-hosts-on-ubuntu/ but it doesn’t work :( cna someone help me ??

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi yannek !! no a did not open the browser before !! and it’s the same think … even when i test a domaine name inexsisted for exemple lalalili.com it doesn’t work :(

Hi,

If you had opened exemple.com in your web browser before you modified your /etc/hosts file, then it is very likely that your web browser cached exemple.com site’s content and respond with such cache content to each next request sent to exemple.com. What I can suggest is to clear browser’s cache and try again then.

Let us know if it helps.