Created
March 21, 2017 21:22
-
-
Save pkarman/1acba5dcbc6226f17705bc70606e4de8 to your computer and use it in GitHub Desktop.
nginx rewrite example
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
| Add this line to your main nginx.conf file, inside the main "server" block. | |
| include rewrite-rules; | |
| Then create a file called "rewrite-rules" in the same directory as nginx.conf. | |
| Example: | |
| rewrite /hello/friend http://example.com/friend break; | |
| rewrite ^/hello$ http://example.com/world permanent; | |
| See docs at http://nginx.org/en/docs/http/ngx_http_rewrite_module.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment