Score:0

Wildcard redirect https://www.*.abc.com to *.abc.com nginx

in flag

I would like to redirect all traffic from

www.*.abc.com to *.abc.com without www prefix . i have 1000+ subdomains on the same application which use only one nginx virtual host file in sites enabled directory .

Score:1
jp flag

You will need to use a regular expression server_name to capture the part of the domain after the www. For example:

server_name ~^www\.(?<domain>.*\.example\.com)$;
return 301 $domain$request_uri;

See this document for details.

sambit avatar
in flag
i have this domain - https://www.*.eu.engagementhq.com . Which i am trying to configure like follows - server_name ~^www\.(?<domain>.*\.engagementhq\.com)$; return 301 $domain$request_uri; but this does not work .
Richard Smith avatar
jp flag
To help you with your specific problem, we would need to see your configuration (use: `nginx -T` (uppercase `T`) to view the entire configuration across all included files), relevant entries from the access and error logs, and `curl -I` showing the actual and expected responses.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.