Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx 1.4.7 hangs on requests with eval #16

Open
tereska opened this issue Mar 30, 2014 · 2 comments
Open

nginx 1.4.7 hangs on requests with eval #16

tereska opened this issue Mar 30, 2014 · 2 comments

Comments

@tereska
Copy link

tereska commented Mar 30, 2014

Nginx is compiled only with this module.
I've downloaded module from:
http://www.grid.net.ru/nginx/download/nginx_eval_module-1.0.1.tar.gz
And it hangs on request.

worker_processes  1;
error_log  logs/error.log  info;

events {
    use epoll;
    worker_connections 1024;
    multi_accept on;
}

http {
    include       mime.types;
    default_type  text/plain;
    sendfile        on;
    keepalive_timeout  5;

    server {
        listen 80;
        server_name test.local;

        location / {

            eval $res {
                proxy_set_header Host $http_host;
                proxy_pass http://127.0.0.1:8081/check;
            }

            if ($res = 'spam') {
                return 401;
            }
            if ($res != 'spam') {
                return 404;
            }
        }

    }

}

I can see communication with my upstream server:

127.000.000.001.42387-127.000.000.001.08081: GET /check HTTP/1.0
Host: test.local
Connection: close
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Cache-Control: max-age=0


127.000.000.001.08081-127.000.000.001.42387: HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 11
Date: Sun, 30 Mar 2014 11:37:29 GMT
Connection: close

exampletext

Request and response are OK but after that nothing happend. Request hangs...

From port 80 perspective I have:

010.000.002.002.54814-010.000.002.015.00080: GET / HTTP/1.1
Host: test.local
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cache-Control: max-age=0

And after couple of seconds connection is closed.

Help me. Thanks!

@remort
Copy link

remort commented May 12, 2022

Same problem. I can read headers, and query parameters, but when I try to read the request body on the remote side with my Aiohttp server (await self.request.json() for example), request hangs.

@remort
Copy link

remort commented May 12, 2022

As for me, it happens because nginx didn't read the request body yet. This is exactly why we use lua_need_request_body on; in ngx_lua module. Though, I don't know how to say to eval module to read the body in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants