-
-
Save dammyammy/2b0de4bed6cbb3d47d0371993d294254 to your computer and use it in GitHub Desktop.
Sendy NGINX Configuration works with Sendy 2 and NGINX 1.8 https://sendy.co/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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