M
M
ML2017-09-14 19:17:14
Nginx
ML, 2017-09-14 19:17:14

nginx server blocks?

Previously, for development, I deployed nginx to windows in nginx.conf I wrote: server_name site.local
And in the windows hosts file I wrote:
127.0.0.1 site.local
After which I could go to site.local
Recently I decided to switch to a unix-like system (mac os) and I wonder how to do something similar there, or can everything be solved at the nginx level?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2017-09-14
@staffID

just like on Windows.
the host file is in /etc.

A
Axian Ltd., 2017-09-14
@AxianLTD

Unix already has a localhost entry. And it's more correct to add 127.0.1.1 (etc.) to hosts. Including in windows. Localhost may be needed by other programs or the system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question