Skip to content

Instantly share code, notes, and snippets.

@tucq88 tucq88/crontab
Last active Nov 11, 2019

Embed
What would you like to do?
Nginx config for Sendy. With Ubuntu@18.04, php@7.3, nginx@1.14.0
# sudo crontab -e
*/1 * * * * php /var/www/html/sendy//import-csv.php > /dev/null 2>&1
*/5 * * * * php /var/www/html/sendy//scheduled.php > /dev/null 2>&1
*/1 * * * * php /var/www/html/sendy//autoresponders.php > /dev/null 2>&1
server {
root /var/www/html/sendy;
index index.php index.html index.htm;
server_name example.com;
autoindex off;
add_header X-Robots-Tag "noindex, noarchive";
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~ /\. { deny all; log_not_found off; access_log off; return 404; }
location / {
try_files $uri $uri/ /$uri.php$is_args$args; # $is_args converts to a ? if true
}
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 /confirm/ {
rewrite ^/confirm/(.*)$ /confirm.php?i=$1 last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 30d;
}
}
server {
if ($host = example.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name example.com;
return 404;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.