This will be a very quick and easy example. Sometimes you may need to use Nginx as a front end, webcache, load balancer or front end proxy. As a clue in Nginx speak they are all the same thing.
Things like this can come in very useful not only for load balancing but also if you’re navigating IPSec VPNs.
Open or create the site you wish to use Nginx as a front end for, for instance:
nano /etc/nginx/sites-enabled/gypthecat.com.conf
You will want the site to look like the following:
upstream www.gypthecat.com {
server 11.22.33.44;
}server {
server_name www.gypthecat.com;
location / {
proxy_pass http://www.gypthecat.com;
}
access_log /var/log/nginx/access.log;
}
Save the file, and exit out.
Reload Nginx:
service nginx restart
And you should be good to go! Keep an eye on /var/log/nginx/access.log for whats going on.
No Comment