Last active
January 19, 2021 23:34
-
-
Save miguelmota/93af3f38de440813b29fa40e44cb8a5d to your computer and use it in GitHub Desktop.
NGINX rewrite with no redirect by using proxy_pass and use custom path
This file contains 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
if ($http_user_agent ~* 'curl') { | |
rewrite ^(.*)$ /curl_rewrite/$1; | |
} | |
location /curl_rewrite/ { | |
rewrite ^/curl_rewrite/(.*)$ /some-path/$1?$query_string break; | |
proxy_pass http://localhost:8080; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment