Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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