G
G
Grag2014-06-24 19:25:02
PHP
Grag, 2014-06-24 19:25:02

How to create virtual hosts in Nginx?

Hello. I installed php5.5+php-fpm+mysql+nginx on Mac OS X Mavericks using this link , now I can't understand what's what...
1. Where to read about the device of this assembly (in order to understand what I stuck together and learn how to use it)
2. How to set up vhosts here? Or how to keep a couple of sites, how to add or delete them. (It is desirable to be very detailed, because I do not understand the server admin.)
3. What to do with SSL (how to write out what it is)?
I know, noob questions, but 2 hours of searching did not give a clear picture in my eyes. Please explain as simply and clearly as possible

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vit, 2014-06-24
@fornit1917

Excuse me, but the answers to your questions are VERY easy to google.
To create multiple virtual hosts, you need to define multiple server sections in the nginx config, for example:

http {
  index index.html;
 
  server {
    server_name www.domain1.com;
    access_log logs/domain1.access.log main;
 
    root /var/www/domain1.com/htdocs;
  }
 
  server {
    server_name www.domain2.com;
    access_log  logs/domain2.access.log main;
 
    root /var/www/domain2.com/htdocs;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question