Join the community today
Register Now

Nginx Nginx + Sendy

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

Tags:
  1. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    6:36 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 Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    6:36 PM
  3. eva2000

    eva2000 Administrator Staff Member

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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 Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    6:36 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

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    missing the very first location context correction

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

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    6:36 PM
    Still 404's.
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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

    4,987
    1,186
    113
    May 25, 2014
    Ratings:
    +1,808
    Local Time:
    7:36 AM
    Mainline
    10.2
    Never tried sendy sorry :(
     
  9. Andy

    Andy Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    7:36 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

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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 Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    7:36 PM
  12. eva2000

    eva2000 Administrator Staff Member

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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 Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    7:36 PM
    Weird.
    Btw, sendy just released a new version 2.0 and it is getting much better.
     
  14. rdan

    rdan Well-Known Member

    4,987
    1,186
    113
    May 25, 2014
    Ratings:
    +1,808
    Local Time:
    7:36 AM
    Mainline
    10.2
  15. Andy

    Andy Premium Member Premium Member

    477
    77
    28
    Aug 6, 2014
    Ratings:
    +109
    Local Time:
    7:36 PM
    Just tested the ngx config above and it works.
    Yeah
     
  16. eva2000

    eva2000 Administrator Staff Member

    45,420
    10,303
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,982
    Local Time:
    9:36 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    thanks @Andy for the confirmation :)