Skip to content

Instantly share code, notes, and snippets.

@freekmurze
Created August 31, 2019 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save freekmurze/d75d26a6f5127c8918e6108a1338a5fd to your computer and use it in GitHub Desktop.
Save freekmurze/d75d26a6f5127c8918e6108a1338a5fd to your computer and use it in GitHub Desktop.
Nginx config sendy
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name sendy.freek.dev sendy.murze.be;
root /home/forge/sendy.freek.dev;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/sendy.freek.dev/xxxxxx/server.crt;
ssl_certificate_key /etc/nginx/ssl/sendy.freek.dev/xxxxxx/server.key;
autoindex off;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ $uri.php?$args;
}
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 = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/sendy.freek.dev-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment