Answer the question
In order to leave comments, you need to log in
How to make dnsmasq and nginx friends?
I installed dnsmasq in order to move in development from accessing projects by ip + port to domain names.
Registered in dnsmasq.config
listen-address=127.0.0.1
address=/dev/127.0.0.1
server {
listen 80;
listen [::]:80;
server_name *.project_1.dev;
Answer the question
In order to leave comments, you need to log in
.dev has been out of business for a long time. since this zone became a valid tld managed by Google.
With an asterisk in the initial config, a 3rd level domain is expected. Type in the browser, for example, www.project_1.dev
- it should work without changes in the config.
Instead of server_name *.project_1.dev;
necessary server_name .project_1.dev;
(still the same, but without the asterisk)
This will be equivalent server_name project_1.dev *.project_1.dev;
See the documentation of the ngx_core_module module - server_name
look in /etc/resolv.conf
, this is where the system DNS servers are registered, which nginx also uses.
You need to replace the existing ones with 127.0.0.1 - then everything will go through dnsmasq.
In general, instead of dnsmasq, they could simply use static entries in /etc/hosts.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question