Nginx, Proxy, and Mail Service

August 18, 2014 1.1k views

when I setup my config that way: User -> Internet -> Proxy <-> My Server
How I need to change settings on the Proxy (wich is nginx) to pass also and the emails, so it will proxy all, sites (port 80, 443) and email which is send from my server to my costumers? For mail server I just use sendmail, wich will use php for sending email itself, because don't need full mail server, just that my site can handle sending messages from my server to my customers...

1 Answer

Nginx can be used to act as a reverse proxy for web services. This guide will assist you in setting that up. To the best of my knowledge, nginx can not proxy mail services.

This tutorial will show you how to configure Nginx as both a web server and as a reverse proxy for Apache – all on one Droplet. Depending on the web application, code changes might be required to keep Apache reverse-proxy-aware, especially when SSL sites are configured. To ensure this, we will install an Apache module named **mod_rpaf** which rewrites certain environment variables so it appears that Apache is directly handling requests from web clients.
Have another answer? Share your knowledge.