nginx server_name wildcard or catch-all

前端 未结 7 745
长情又很酷
长情又很酷 2020-12-04 06:57

I have an instance of nginx running which serves several websites. The first is a status message on the server\'s IP address. The second is an admin console on admin.d

7条回答
  •  囚心锁ツ
    2020-12-04 07:22

    If you also want to catch requests with empty Host header (which is allowed in HTTP/1.0) you can use both regex and empty server_name:

    server {
        listen      80;
        server_name ~. "";
    }
    

提交回复
热议问题