Welcome! Log In Create A New Profile

Advanced

Re: SCGI

Andrey Repin
December 08, 2011 11:52AM
Здравствуйте, Уважаемый(-ая, -ое) excanoe!

e> Столкнулся с данной ошибкой: ответы от
e> scgi сервера не сжимаются.

И как вы это определили?

curl -siIH "Accept-Encoding: deflate,gzip" http://хост/адрес_скрипта
что говорит?

e> привожу код сервера на руби и
e> конфигурацию nginx (конфигурация
e> тестовая):

e> ######################################################################

e> worker_processes 1;

e> events{
e> worker_connections 1024;
e> }

e> http{
e> server_tokens off;

e> default_type text/plain;

e> gzip on;
e> gzip_types text/plain;

e> types{
e> text/plain js css txt;
e> }

e> server{
e> return 404;
e> }

e> server{
e> server_name localhost;

e> scgi_buffering off;

e> location / {
e> try_files $uri @engine;
e> }

e> location @engine {
e> include scgi_params;
e> scgi_pass 127.0.0.1:9000;
e> }
e> }
e> }

e> ######################################################################

e> #coding: utf-8

e> require "socket"
e> require "thread"
e> require "openssl"
e> require "erb"

e> scgid=Socket.new(Socket::AF_INET,Socket::SOCK_STREAM,0)
e> scgid.bind(Socket.pack_sockaddr_in(9000,"127.0.0.1"))
e> scgid.listen(1)

e> loop{
e> scgi=scgid.accept[0]
e> Thread.new{
e> begin

e> f=File.new(Time.now.to_f.to_s+".bin","wb")
e> while(f.syswrite scgi.sysread 4096)==4096
e> end
e> f.close
e> File.unlink f.path

e> scgi.syswrite "Status: 200 OK\r\nContent-Type:
e> text/plain\r\n\r\n"

e> scgi.syswrite "ok"

e> #header_size =""
e> #header_pairs =""
e> #while (header_size=~/:/)==nil
e> # header_size+=scgi.sysread 1
e> #end
e> #header_size=header_size.to_i
e> #while header_pairs.size<header_size
e> # header_pairs+=scgi.sysread 1
e> #end

e> #env=Hash[*header_pairs.split("\0")]

e> #scgi.syswrite "Status: 200 OK\r\nContent-Type:
e> text/plain\r\nContent-Length: "+env.to_s.size.to_s+"\r\n\r\n"
e> #scgi.syswrite env.to_s

e> scgi.close
e> rescue=>err
e> p err
e> end
e> }
e> }

e> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,219800,219800#msg-219800

e> _______________________________________________
e> nginx-ru mailing list
e> nginx-ru@nginx.org
e> http://mailman.nginx.org/mailman/listinfo/nginx-ru


--
С уважением

Andrey Repin (hell-for-yahoo@umail.ru) четверг, 08.12.2011, <20:43>

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

scgi

Anton Kiryushkin October 22, 2010 07:18AM

Re: scgi

Vasiliy G Tolstov October 22, 2010 07:22AM

Re: scgi

Maxim Dounin October 22, 2010 07:36AM

Re: scgi

Anton Kiryushkin October 22, 2010 07:42AM

Re: scgi

Vasiliy G Tolstov October 22, 2010 08:26AM

Re: scgi

Igor Sysoev October 22, 2010 08:40AM

Re: scgi

Anton Kiryushkin October 22, 2010 08:54AM

Re: scgi

Anton Kiryushkin October 22, 2010 07:40AM

Re: SCGI

Andrey Repin December 08, 2011 11:52AM

Re: SCGI

excanoe December 08, 2011 12:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready