nginx - Can the same server set up two domain names to access two different projects?
黄舟
黄舟 2017-05-16 17:04:35
0
4
513

For example, there are two different projects developed by PHP and Ruby respectively and want to use them on the same server.
URL of PHP project:
http://site1.com
Ruby project URL:
http://site2.com
There is a port problem here, the default is 80. It is of course no problem to add another port after another URL to access, but if not, how to use Web Server settings?
Apache and Nginx both work. Is there a solution?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
阿神

Use nginx reverse proxy to change one of the listening ports to another port, add a virtual host to nginx, and then reverse proxy it

为情所困

Both nginx and apache can directly create two virtual hosts, just use different directories, which is equivalent to putting two websites on one server. It is very simple.

阿神

Two server nodes are configured in nginx, both listening 80, but the server_name is different

阿神

Just set up different virtual hosts, this is true for both nginx and apache.

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