Skip to content

Instantly share code, notes, and snippets.

@saaiful
Created May 3, 2019 12:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save saaiful/6f0f32de64d5fccd793b3ce5059c8bb2 to your computer and use it in GitHub Desktop.
Save saaiful/6f0f32de64d5fccd793b3ce5059c8bb2 to your computer and use it in GitHub Desktop.
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen ip:port;
server_name domain.name;
root root_folder;
index index.php index.html index.htm;
location / {
location = / {
try_files $uri $uri/ /index.php?$query_string;
}
try_files $uri $uri/ /$uri.php?$query_string;
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 ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9005;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
}
@anil1kuppa
Copy link

anil1kuppa commented Dec 20, 2021

If I follow the above, it's downloading the php : https://sendy.confluenceedu.com/_compatibility.php?i=1

@anil1kuppa
Copy link

@saaiful
Copy link
Author

saaiful commented Dec 25, 2021

@anil1kuppa Seems like your have php-fpm issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment