Answer the question
In order to leave comments, you need to log in
Accepting requests only from a specific domain on nginx?
Hello. There is a main site sitename.ru and an API server located at api.sitename.ru. Both are powered by Nginx.
Is it possible to configure Nginx so that api.sitename.ru only accepts requests from sitename.ru?
Answer the question
In order to leave comments, you need to log in
if ($http_host != "sitename.ru") {
return 403;
}
if ($remote_addr != 127.0.0.1) {
return 403;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question