New answers tagged http
1
vote
Nginx Embedded Variables - How do you get the domain name used in a request?
From server_name variable documentation, you can try with "named capture groups". This handles subdomains (but not the subdomain-less corner cases...):
server {
listen 80;
listen [::]...
Top 50 recent answers are included
Related Tags
http × 2243nginx × 409
https × 373
apache-2.2 × 320
proxy × 174
linux × 156
ssl × 131
redirect × 129
http-headers × 115
iis × 112
web-server × 112
apache-2.4 × 111
reverse-proxy × 102
networking × 95
php × 78
domain-name-system × 68
cache × 66
windows × 61
ubuntu × 61
security × 61
tcp × 58
load-balancing × 55
haproxy × 55
port × 47
httpd × 46