cdiori
By:
cdiori

NGINGX Redirections

January 20, 2014 1.6k views
I have a quick question around nginx server. I have setup eight server blpcks(virtual host). One virtual host was setup to redirect, whenever I visit a page that is unavailble on any of my other sitesI am automatically redirected per the setup of the one site for redirection instead of an error page. How would I change this behaviour.
3 Answers
One virtual host was setup to redirect, whenever I visit a page that is unavailble on any of my other sitesI am automatically redirected per the setup of the one site for redirection instead of an error page. How would I change this behaviour.
I'm not sure I understand what you mean. Can you give an example? Also pastebin your nginx config.
Let me explain better. I have domain A redirected to a youtube channel. I now try to visit domain B but I enter some part of the url wrong. Instead of getting an error page I am redirected to the youtube channel..

Pastebin Domain A config
http://pastebin.com/5S510Vy7
Pastebin Domain B config
http://pastebin.com/RUcKE1vN
You need to create a default virtualhost. If you don't have one enabled, nginx will use the first virtualhost (Domain A's) as the default.

Create a file called /etc/nginx/sites-enabled/0-default with
Have another answer? Share your knowledge.