I use nginx to work with application files. Currently, when I send an HTTP request, I am specifying the port that nginx is listening on and it is serving the corresponding files. But I do not want to use the port in my request: I would like to send a hopeless HTTP request (that is, port 80), and let nginx decide to redirect the port to the domain. That is, if I request www.example.com, it should intercept the request and redirect it to the port at www.example.com. I know that Apache Server supports defining virtual host rules that achieve the same goal. Can I do this with nginx?
source share