Skip to content

error 404 on Newsletter preview on nginx

edited May 2013 in Troubleshooting

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;
}
}

Comments

This discussion has been closed.