Home  >  Q&A  >  body text

How to use linux+nginx to provide cname service?

Scenario:
A multi-user system, on a cloud server linux+nginx+flask, the external domain name is www.abc.com, each registered user automatically generates a second-level domain name of uxxx.abc.com.

Requirements:
Some users need to use their own second-level domain names to access our services, but we do not want to let users bind IP through A records. We hope to use cname to allow users to use their own domain names www.uxxx. com cname to uxxx.abc.com to access.

How to achieve this? How to configure nginx? Does the program need to cooperate accordingly?

PHP中文网PHP中文网2713 days ago881

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 17:20:06

    http dns are two different things, but it doesn’t matter.

    There is actually only one problem that needs to be solved here: how to get the mapping relationship between the user’s own domain name and the user name.

    It is conceivable that it cannot be solved simply through the web server, because it needs to access the storage service (storage user & domain name mapping relationship). It requires a little magic such as: ngx_lua, or it can be solved at the application layer.

    reply
    0
  • Cancelreply