Nginx Configuration File for Sendy

Published on June 15, 2019 46 sec read

We're available to do freelance project. Take a look at our services!

Sendy is a self-hosted newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES) at 100x cheaper than other hosted solutions.

For Apache, it includes the .htaccess file. That’s why we don’t need any extra configuration for the Apache server.

But for Nginx, we have to configure the Nginx to run Sendy on our server. Here is the example configuration file for Sendy:

server {
    listen 80;
    listen [::]:80;


    autoindex off;
    index index.php index.html;

    root /srv/www/;
    access_log /srv/www/;
    error_log /srv/www/;

    location / {
        try_files $uri $uri/ $uri.php?$args;
        # Don't allow search engines to index any 
        add_header X-Robots-Tag "noindex, noarchive";

    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 ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        access_log off;
        log_not_found off;
        expires 30d;
Thank you. 🙂

Monthly Newsletter

One email a month, packed with the latest tutorials, delivered straight to your inbox.
We'll never send any spam or promotional emails.

Hey, I'm Md Obydullah. I build open-source projects and write on Laravel, Linux server, modern JavaScript and more on web development.


Leave a Reply

Your email address will not be published. Required fields are marked *