0

I've defined a new server block with a regex match and redirect:

server {
  listen 80;
  server_name ~^homersimpson.(?<domain>.*)$;
  rewrite ^ $scheme://$domain/apply?ref=thesimpsons redirect;
}

But the URL after curling is without the query string?

curl -w "%{url_effective}\n" -I -L -s -S https://homersimpson.domain.com -o /dev/null 
https://homersimpson.domain.com/

How do i rewrite the url with a query string?

1 Answer 1

1

try this :

server {
  listen 80;
  server_name ~^homersimpson.(?<domain>.*)$;
  return 301 $scheme://$domain/apply?ref=thesimpsons;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.