Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Created May 27, 2022 14:35
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 ahmadawais/2d81149880982e12e278a755c95a635b to your computer and use it in GitHub Desktop.
Save ahmadawais/2d81149880982e12e278a755c95a635b to your computer and use it in GitHub Desktop.
Sendy NGNIX Config 2022

Bascially all you really need is this

location / {
		try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
	}

But to be on the safe side I added everything below:

location / {
		try_files $uri $uri/ $uri.html $uri.php$is_args$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 /confirm/ {
                rewrite ^/confirm/(.*)$ /confirm.php?i=$1 last;
        }

And it works really well.

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