Report this

What is the reason for this report?

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

Posted on March 18, 2021

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 ??



This textbox defaults to using Markdown to format your 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,

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.

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 :(

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.