Last Updated: 17 April 2018
By Maynard Paton

Configuring Nginx For Sendy

Welcome to Part 11 of Installing Sendy and Virtualmin on Amazon Web Services (AWS).

This page describes how to configure Nginx to ensure Sendy runs correctly on your AWS server. Nginx (pronounced 'engine-ex') is webserver software that is used for enhancing website speed and performance. (Source: Tharindu Kumara)

Here are the steps to follow

1) Open a new Terminal window and at the command line, enter:

ssh root@

...replacing with the Elastic IP created within Part 4. Enter the server root password set in Part 3.

2) At the command line, enter: 

nano /etc/nginx/sites-available/Your Sendy Installation URL.conf

(For the purposes of this guide, I have used /etc/nginx/sites-available/

3) You should  see something like this, and be able to edit the file:

4) Use the downward arrow key to scroll through the file until your reach the following line:

fastcgi_param HTTPS $https;

5) Insert a few blank lines below by using the enter key:

6) Paste the following text within the extra blank lines:

location = / {
index index.php;
location / {
if (!-f $request_filename){
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
location /l/ {
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
location /t/ {
rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
location /w/ {
rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
location /unsubscribe/ {
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
location /subscribe/ {
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;

Your file should now look similar to this:

7) Press CTRL + O

File Name to Write: should appear. Press Enter.

8) Press CTRL + X and you should return to the command line:

9) At the command line, enter:

systemctl restart nginx.service

The command line should re-appear:

10) All done!

Stay logged in to the Terminal window, and click here to start Part 12. Alternatively, click here to return to the Introduction.

If you have any questions or comments about this page, please let me know so I can keep this website as helpful as possible.

Happy installing!

Maynard Paton

(Want to learn more? Click here to visit the full website index.)


Sendy Is Fast, Reliable And Cheap!

We found that as our subscribers grew, we were creeping up to over $100 a month for a traditional cloud-based email marketing platform. We decided to explore alternatives and ended up landing on a great self-hosted email marketing solution called Sendy.

Overall, we've found Sendy to not only be an excellent alternative to MailChimp, but to blow it away as far as speed, usability and functionality are concerned.

Sendy is fast, reliable and cheap.

Mike Johnston, , Sendy customer

MailChimp 'Disruptor'. $59 One-Off Fee. Full Refund Available.