Nginx convert subdomain to path component without redirect

前端 未结 1 1352
生来不讨喜
生来不讨喜 2020-12-04 16:06

The idea is to take incoming requests to http://abc.example.com/... and rewrite them to http://example.com/abc/...

That\'s easy enough to d

相关标签:
1条回答
  • 2020-12-04 16:07
    # abc.example.com
    server {
      listen 80;
      server_name abc.example.com;
      location / {
        proxy_pass http://127.0.0.1/abc$request_uri;
        proxy_set_header Host example.com;
      }
    }
    
    0 讨论(0)
提交回复
热议问题