Hi,

On 19.03.2013 16:31, Luka Perkov wrote:
Hi all,

I'm using nginx as a frontend for my SCGI application and I want to
handle authentication in my SCGI code. I have to deal with POST
requests. Is it ok that nginx sends "401 Unauthorized" after sending
"100 Continue"?

Are both requests bellow correct?


Both requests do look basically correct just like the nginx's and curl's behavior. You didn't supply any credentials for authentication to continue.

You can use -u curl option to explicitly specify <user:password> on the command line either -n option to read 'em from your netrc. Curl will at least try to authenticate itself with the supplied credentials then.

You could also find this document useful

<http://curl.haxx.se/docs/httpscripting.html>

I'm asking because of this curl message: "HTTP error before end of send,
stop sending".


Hope it helps.

Regards,
Vladimir

Luka

$ curl -v -X POST -d "@/path/to/some/blob" http://127.0.0.1:8000/
* About to connect() to 127.0.0.1 port 8000 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: 127.0.0.1:8000
Accept: */*
Content-Length: 3398
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

< HTTP/1.1 100 Continue
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.3.14
< Date: Tue, 19 Mar 2013 12:11:16 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< WWW-Authenticate: Basic realm="bla-bla-bla"
* HTTP error before end of send, stop sending
<
* Closing connection 0


$ curl -v -X POST -d "@/dev/null" http://127.0.0.1:8000/
* About to connect() to 127.0.0.1 port 8000 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: 127.0.0.1:8000
Accept: */*
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 401 Unauthorized
< Server: nginx/1.3.14
< Date: Tue, 19 Mar 2013 12:23:17 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< WWW-Authenticate: Basic realm="bla-bla-bla"
* HTTP error before end of send, stop sending
<
* Closing connection 0


_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to