Sendy Nginx Configuration

Hi , I have seen many people struggling of nginx configuration of the sendy application. 
As the sendy application is not tested on the nginx and its rewrite rules,
I have written the configuration and tested it.  
I will add the configuration below here

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

        root /var/www/html;

# Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name (domain_name);
   location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                #try_files $uri $uri/ =404;
                #try_files $uri $uri/ /index.php?$args;
                access_log off;
                error_log off;
                rewrite ^/sendy/(l|t|w)/([a-zA-Z0-9\/]+)$ /sendy/$1.php?i=$2&$args;
                rewrite ^/sendy/(u?n?subscribe)/(.*)$ /sendy/$1.php?i=$2&$args;
                try_files $uri $uri/ $uri.php?$args;


        }

        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 ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
                access_log off;
                log_not_found off;
                expires 30d;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

}

So this is my nginx configuration for the sendy application , If any problem please comment down , I will be more than happy to help you .
Cheers 

Comments


  1. Thanks For Sharing this Information!!!
    Sendybay help you install Sendy setup in one click. Sendy Hosting at SendyBay is easy and time saving. Get started with email marketing Sendy Installation.

    ReplyDelete

Post a Comment

Popular posts from this blog

Important GIT COMMANDS

Docker Compose YML - Application , REDIS , MongoDB