Answer the question
In order to leave comments, you need to log in
How to bind a domain name to an ip address in nginx?
I'm trying to bind a domain name to an ip in nginx. It does not work. At the same time, localhost from nginx works fine. I am loading nginx as administrator. What could be the problem.?
in nginx.cohf:
server {
listen 80;
server_name nenfy.com;
root C:/My_site;
index index.html index.php;
access_log C:/nginx/logs;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
In hosts:
127.0.0.1 nenfy.com
127.0.0.1 www.nenfy.com
Answer the question
In order to leave comments, you need to log in
You need to make sure that nginx listens to the interface you need, in this case it is localhost.
Replace
listen 80;
with
listen 127.0.0.1:80;
Error
2020/07/12 21:39:53 [emerg] 7248#14284: bind() to 127.0.0.0:80 failed (10049: The requested address is not valid in its context)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question