Created
October 18, 2015 17:49
-
-
Save algotrader-dotcom/57575bbfede4cc16c01e to your computer and use it in GitHub Desktop.
Nginx rewrite url to php backend app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # This rewrite http://domain.com/dl/121/abc.pdf to PHP as http://domain.com/dl.php?nid=121&url=abc.pdf | |
| # | |
| server { | |
| ... | |
| location /dl { | |
| rewrite ^/dl/(.*)/(.*)$ /dl.php?nid=$1&url=$2 last; | |
| break; | |
| } | |
| ... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment