Skip to content

Instantly share code, notes, and snippets.

@pengjiayou
Forked from nathanielvarona/sendy.nginxconf
Created November 30, 2016 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pengjiayou/eac8fa92b3e88c9f659f79c4de5f90ed to your computer and use it in GitHub Desktop.
Save pengjiayou/eac8fa92b3e88c9f659f79c4de5f90ed to your computer and use it in GitHub Desktop.
Sendy NGINX Configuration works with Sendy 2 and NGINX 1.8 https://sendy.co/
server {
#listen 80;
#listen [::]:80;
server_name sub.domain.tld;
access_log /var/log/sendy/nginx.access.log;
error_log /var/log/sendy/nginx.error.log;
root /opt/sendy;
autoindex off;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args ;
if (!-f $request_filename){
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
}
}
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 /subscribe/ {
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
}
location /unsubscribe/ {
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
}
location /confirm/ {
rewrite ^/confirm/(.*)$ /confirm.php?i=$1 last;
}
location ~ \.php$ {
expires off;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME /opt/sendy$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 1200;
send_timeout 1200;
proxy_read_timeout 1200;
keepalive_timeout 0;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
access_log off;
log_not_found off;
expires max;
}
location ~* /\.ht {
deny all;
access_log off;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment