Skip to content

Instantly share code, notes, and snippets.

@luismisanchez
Forked from bftanase/secure_link.php
Created March 23, 2021 18:05
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 luismisanchez/359928c10c4cb0d08ca27e541fa54fd3 to your computer and use it in GitHub Desktop.
Save luismisanchez/359928c10c4cb0d08ca27e541fa54fd3 to your computer and use it in GitHub Desktop.
generate URL for nginx secure_link
@luismisanchez
Copy link
Author

luismisanchez commented Mar 23, 2021

https://www.nginx.com/blog/securing-urls-secure-link-module-nginx-plus/

Nginx.conf

location /securetest {
	    alias html/mhmsecure/securetest;
            secure_link $arg_md5,$arg_expires;
            secure_link_md5 "$secure_link_expires$uri$remote_addr live21.ir";

            if ($secure_link = "") { return 403; }
            if ($secure_link = "0") { return 410; }        
}

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