Working with Ubuntu + nginx sockets

Question:

Good day!

I'm trying to figure out how to optimize the server and how Bitrix works on it. Bitrix has a system configuration test, in which it checks some server parameters and PHP configuration. As a result of passing the test, he swears about working with sockets: “Error! Does not work". What needs to be checked, tweaked in the configs?

The system itself gives such comments to this error:

A network connection is made from the web server to itself. This is necessary to check the operation of network functions, and is also required for a number of subsequent tests.

Usually, the problem occurs if the connection is denied by the firewall, access to the administrative part is denied by IP, or HTTP / NTLM authorization is required to enter the site.

The test proceeds as follows. A script is launched in the browser from under the admin, which makes all the checks.

Apparently, this function is responsible for this check.

function check_socket()
{
    $strRequest = "GET "."/bitrix/admin/site_checker.php?test_type=socket_test&unique_id=".checker_get_unique_id()." HTTP/1.1\r\n";
    $strRequest.= "Host: ".$this->host."\r\n";
    $strRequest.= "\r\n";

    $retVal = false;

    if ($res = $this->ConnectToHost())
        $retVal = IsHttpResponseSuccess($res, $strRequest);

    if (!$retVal)
        $this->arTestVars['check_socket_fail'] = 1;
    return $retVal;
}

UPD: Logs of this check of Bitrix itself :

2015-Aug-08 16:58:45 Работа с сокетами (check_socket): Fail
Connection to example.ru:80 Success
== Request ==
GET /bitrix/admin/site_checker.php?test_type=socket_test&unique_id=c14dc6ee0355801288c2fa1175e31c70 HTTP/1.1
Host: example.ru


== Response ==
HTTP/1.1 404 Not Found
Server: nginx/1.4.6 (Ubuntu)
Date: Sat, 08 Aug 2015 13:58:45 GMT
Content-Type: text/html
Content-Length: 177
Connection: keep-alive

== Body ==
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>

==========

Answer:

Add to /etc/hosts :

127.0.0.1 example.ru #указываем то имя домена, с которого делали проверку
Scroll to Top