Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

error 404 on Newsletter preview on nginx
  • Vote Up0Vote Down esusloesuslo
    Posts: 3Sendy user

    I have set up sendy on nginx, everything seems to work fine, I am able to send out campaigns, but the Newsletter preview shows 404. Here is my config of nginx (I combined it in to 1 file, though sendy and worpress rules are included as separate files):

    server {
    server_name myhostname.com;
    root /var/www/myhostname.com;
    
    location = /favicon.ico {
    log_not_found off;
    access_log off;
    }
    
    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }
    
    location ~ /\. {
    deny all;
    }
    
    location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
    }
    
    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 / {
    try_files $uri $uri/ /index.php?$args;
    }
    
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
       access_log off; log_not_found off; expires off;
    }
    
    location ~ \.php$ {
    try_files $uri =404;
    
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass php;
    }
    }
    
  • 1 Comment
  • Vote Up0Vote Down BenBen
    Posts: 3,484Sendy support

    Hi ,

    I have completely no experience with nginx. Sendy isn't supported or tested on it.

    Hope this will help you → http://forum.sendy.co/discussion/142/nginx-rewrite-rules/p1

    Thanks.

    Ben

This discussion has been closed.
All Discussions