Hello!
My Nginx config currently looks like this:
server {
listen 80;
server_name ~^(www\.)?(?<domain>.+?).abc$;
root /usr/share/nginx/$domain;
index index.html index.htm;
}
It works like it should, when I visit http://example.abc it sets the root to the example directory. What I want though is for it to work with any top-domain instead of just .abc.
I have tried "server_name ~^(www\.)?(?<domain>.+)$;" from http://nginx.org/en/docs/http/server_names.html but all it does is return a 404 on every request.
Any help is appreciated!
My Nginx config currently looks like this:
server {
listen 80;
server_name ~^(www\.)?(?<domain>.+?).abc$;
root /usr/share/nginx/$domain;
index index.html index.htm;
}
It works like it should, when I visit http://example.abc it sets the root to the example directory. What I want though is for it to work with any top-domain instead of just .abc.
I have tried "server_name ~^(www\.)?(?<domain>.+)$;" from http://nginx.org/en/docs/http/server_names.html but all it does is return a 404 on every request.
Any help is appreciated!