I am unable to get the subdomain from the URL in NGINX
- by Jean-Nicolas Boulay Desjardins
I am unable to get the subdomain from the URL in NGINX.
Here is my config:
server {
listen 80;
server_name ~^(?<appname>)\.example\.com$;
rewrite ^ https://$appname.example.com$request_uri? permanent;
}
When I do:
http://bob.example.com/
I am sent to:
https://.example.com/
I don't know what I am doing wrong.
I am…