Thank you bgentil,for the answer but the issue is coolsite.com is going to be configured dynamically by the user.It will not be known beforehand to us.So,I want the second server block to handle anything other than app.mysite.com.I am not sure but if I make the first server the default one listen 80 default_server;` in this way will it handle the requests correctly?