hi. any update on this.
i hope many developers will be looking for similar solution for SaSS product hosted on single domain and served to individual users by subdomains, and when end user requires custom domain to show content from a sub-domain this workaround is required.
based on some solutions i tried below steps.
1.
add map function on /etc/nginx/nginx.conf inside http blockwhen i do this, i get $domain undefined variable error. without $ symbol, there is no error, but again it doesnt seems to be working.
2.
added proxy pass on forcessl.tpl file at /usr/local/vesta/data/templates/web/nginx/force-https.stplI need to use map function to get value of domain withoud tld on tpl file.
can you please help me with a solution for this?
i hope many developers will be looking for similar solution for SaSS product hosted on single domain and served to individual users by subdomains, and when end user requires custom domain to show content from a sub-domain this workaround is required.
based on some solutions i tried below steps.
1.
add map function on /etc/nginx/nginx.conf inside http block
Code:
map $domain $domain_without_tld { ~^(?<domain_name>[^.]+)\..+$ $domain_name;}
2.
added proxy pass on forcessl.tpl file at /usr/local/vesta/data/templates/web/nginx/force-https.stpl
Code:
location / { proxy_pass https://%ip%:%web_ssl_port%; proxy_set_header Host $domain_without_tld.%domain_idn%; location ~* ^.+\.(%proxy_extentions%)$ { root %sdocroot%; access_log /var/log/%web_system%/domains/%domain%.log combined; access_log /var/log/%web_system%/domains/%domain%.bytes bytes; expires max; # try_files $uri @fallback; } }
can you please help me with a solution for this?
Statistics: Posted by sparkzara — Sat Dec 30, 2023 9:04 pm