Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx Nginx + Sendy

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by BamaStangGuy, Jan 8, 2015.

Tags:
  1. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    2:17 PM
    We have started to use Sendy but can not get it to work with Nginx.


    Here is our current setup:
    Code:
    location /sendy {
    try_files $uri $uri/ $uri.php?$args;
    }
    
    location /sendy/unsubscribe/ {
    rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
    }
    
    location /sendy/subscribe/ {
    rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
    }
    
    location /sendy/w/ {
            rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
        }
    
        location /sendy/l/ {
            rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
        }
    
        location /sendy/t/ {
            rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
        }
    
    None of the links work. For example:

    https://www.religiousforums.com/sen...CBRywgt6892D32DBfrqw/R08gCBRywgt6892D32DBfrqw

    404's.

    These rewrites are based off: Nginx configuration file example for Sendy (http://sendy.co/). which is what Sendy.co support links to.

    Any idea what CentminMod is doing differently to make this not work?
     
  2. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    2:17 PM
  3. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    unrelated to your issues I believe

    for your issue you misconfigured your rewrites, each target destination rewrite is going to web root and not /sendy/* location i.e.

    Code:
    /w.php?i=$1 last;
    should be
    Code:
    /sendy/w.php?i=$1 last;
    FYI, I'm going to be partially out of action due to https://community.centminmod.com/threads/downtime-when-computer-goes-up-in-smoke.2093/
     
  4. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    2:17 PM
    Still broke with:

    Code:
    location /sendy/ {
    try_files $uri $uri/ $uri.php?$args;
    }
    
    location /sendy/unsubscribe/ {
    rewrite ^/unsubscribe/(.*)$ /sendy/unsubscribe.php?i=$1 last;
    }
    
    location /sendy/subscribe/ {
    rewrite ^/subscribe/(.*)$ /sendy/subscribe.php?i=$1 last;
    }
    
    location /sendy/w/ {
            rewrite ^/w/([a-zA-Z0-9/]+)$ /sendy/w.php?i=$1 last;
        }
    
        location /sendy/l/ {
            rewrite ^/l/([a-zA-Z0-9/]+)$ /sendy/l.php?i=$1 last;
        }
    
        location /sendy/t/ {
            rewrite ^/t/([a-zA-Z0-9/]+)$ /sendy/t.php?i=$1 last;
        }
     
  5. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    missing the very first location context correction

    Code:
    location /sendy/ {
    try_files $uri $uri/ /sendy/$uri.php?$args;
    }
    
     
  6. BamaStangGuy

    BamaStangGuy Active Member

    668
    192
    43
    May 25, 2014
    Ratings:
    +272
    Local Time:
    2:17 PM
    Still 404's.
     
  7. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Unfortunately, not much time to help troubleshooting with my pc problems and never using Sendy before. @Andy I believe has mentioned he's played with Sendy + Amazon SES so maybe he has tips. Wonder if @Matt or @RoldanLT have played with Sendy before ?
     
  8. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    3:17 AM
    Mainline
    10.2
    Never tried sendy sorry :(
     
  9. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    2:17 PM
    @BamaStangGuy I got the same issue trying to get sendy to work on my centminmod box. It doesn't work for the preview url and many other minor links. I followed whatever guide they have on sendy forum to no avail.
    I gave up and just installed sendy on a $5/month DigitalOcean droplet running ubuntu. I use this guide and it works perfectly
    Configuring Sendy and DigitalOcean | Harmony Tech, Inc.
     
  10. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Reading through Sendy.co forums at All Discussions - Sendy Forum seems Nginx hasn't actually been tested officially with Sendy according to the Sendy developer(s) so probably like Andy said Apache is the way. Centmin Mod will eventually have Apache 2.4 (event MPM worker) + PHP-FPM integration for such situations like theses. However, it's not something coming soon given my schedule right now.
     
  11. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    2:17 PM
  12. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks @Andy

    ouch for some reason the url you linked to is going in an infinite loop in my browser halting everything in my browser heh. Will check it out later
     
  13. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    2:17 PM
    Weird.
    Btw, sendy just released a new version 2.0 and it is getting much better.
     
  14. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    3:17 AM
    Mainline
    10.2
  15. Andy

    Andy Active Member

    540
    89
    28
    Aug 6, 2014
    Ratings:
    +132
    Local Time:
    2:17 PM
    Just tested the ngx config above and it works.
    Yeah
     
  16. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:17 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks @Andy for the confirmation :)