How does nginx forward all requests to a domain name?
PHP中文网
PHP中文网 2017-05-16 17:29:51
0
3
779

My nginx is bound to several domain names, but I want these domain names to be used as aliases, and all incoming requests will be forwarded to my main domain name
Currently, I can only configure multiple servers. How should I configure nginx to transfer to a domain name?

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
小葫芦

oneserver 绑定多个域名 : server_name www.fb.com ta.fb.com c.fb.com
jump

if ($host !~* ^www\.fb\.com$)
    {
        rewrite ^/(.*)$ http://www.fb.com/ redirect;
    }    

I haven’t configured it for more than a year, so I don’t know if it’s correct, haha, that’s probably the idea

phpcn_u1582

server_name www.a.com www.b.com www.c.com ;

巴扎黑

Specially, register an account. Tell everyone. There is a semicolon missing on the first floor; hahahahaha after the redirect

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template