Truncated or oversized response headers received from daemon process

2,940 views
Skip to first unread message

Anatoly Piskunov

unread,
Aug 17, 2016, 6:52:23 AM8/17/16
to modwsgi
Hello Graham Dumpelton, and rest of the fellow community! 
i need your competent help with this issue. I've read almost all of the threads, but unfortunately didn't get a solution. 

System details:
5.5.46-0ubuntu0.14.04.2 - (Ubuntu)

user01@vkc-sandbox02:/var/log/apache2$ uname -a
Linux vkc-sandbox02 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Apache/2.4.7 (Ubuntu)
Python 3.4.3 (virtual env)
Python 3.4.3 (system)
Python 2.7 (system)
mod-wsgi (4.5.4)
Django 1.10

user01@vkc-sandbox02:/etc/apache2/mods-enabled$ cat wsgi.conf
<IfModule mod_wsgi.c>
#it's empty
</IfModule>

user01@vkc-sandbox02:/etc/apache2/mods-enabled$ cat wsgi.load
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi-py34.cpython-34m.so

user01@vkc-sandbox02:/etc/apache2/sites-enabled$ cat 000-default.conf

<VirtualHost *:80>
        WSGIDaemonProcess fb_bot python-path=/home/user01/nano_fb_py_bot:/home/user01/.virtualenvs/dev_fbbot_ve/bin:/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages header-buffer-size=32768
        WSGIProcessGroup fb_bot
        WSGIScriptAlias / /home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py
       
<Directory /home/user01/nano_fb_py_bot/nano_fb_py_bot>
       
<Files wsgi.py>
        Require all granted
       
</Files>
       
</Directory>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        LogLevel info wsgi:debug
        ErrorLog ${APACHE_LOG_DIR}/django-error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        Header set Access-Control-Allow-Origin "*"
</VirtualHost>


wsgi.py
import os, sys

from django.core.wsgi import get_wsgi_application
import django.core.handlers.wsgi
import sys
sys
.stdout = sys.stderr
os
.environ.setdefault("DJANGO_SETTINGS_MODULE", "nano_fb_py_bot.settings")
application
= get_wsgi_application()



and finally, views.py 
user01@vkc-sandbox02:~/nano_fb_py_bot/fb_nanosemantics$ cat views.py
from django.shortcuts import render
from django.views import generic
from django.http.response import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
import traceback
import pymysql.cursors
import json, requests, re
import hashlib
from multiprocessing import Pool
PAGE_ACCESS_TOKEN
= 'some_token'
VERIFY_TOKEN
= '123456789'


# Create your views here.
class FacebookBotView(generic.View):
   
def get(self, request, *args, **kwargs):
     
if self.request.GET['hub.verify_token'] == VERIFY_TOKEN:
      return HttpResponse(self.request.GET['hub.challenge'])
     else:
      return HttpResponse('Error, invalid token')

   
@method_decorator(csrf_exempt)
   
def dispatch(self, request, *args, **kwargs):
     
return generic.View.dispatch(self, request, *args, **kwargs)

When i run Django app from development web server,
python manage.py runserver 127.0.0.1:8000
everything works like a charm when i do curl 127.0.0.1:8000/Path_to_View/LInk?hub.verify_token=some_token&hub.challenge=some_challenge
when i don't pass get params, i see error (and that's great!!!)

But when i try access this url served by apache - i get internal server error 500.
And no error traceback shown in my virtualhost apache logs (please see below).

if i simplify views.py, as below 
class FacebookBotView(generic.View):
   
def get(self, request, *args, **kwargs):
     
return HttpResponse('Hello World!')

   
@method_decorator(csrf_exempt)
   
def dispatch(self, request, *args, **kwargs):
     
return generic.View.dispatch(self, request, *args, **kwargs)
Page accessible via apache, and i get web response.
but if i make a syntax, or ident mistake, or call some function - the error comes back again, with no traceback.

And i mention again - none of this appears with dev. web server.


[Wed Aug 17 16:06:49.735396 2016] [wsgi:info] [pid 4122] mod_wsgi (pid=4122): Create interpreter 'vkc-sandbox02.kcell.kz|'.
[Wed Aug 17 16:06:49.765976 2016] [wsgi:info] [pid 4122] mod_wsgi (pid=4122): Adding '/home/user01/nano_fb_py_bot' to path.
[Wed Aug 17 16:06:49.766645 2016] [wsgi:info] [pid 4122] mod_wsgi (pid=4122): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/bin' to path.
[Wed Aug 17 16:06:49.767402 2016] [wsgi:info] [pid 4122] mod_wsgi (pid=4122): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages' to path.
[Wed Aug 17 16:06:49.789132 2016] [wsgi:info] [pid 4122] [remote 10.10.165.20:57995] mod_wsgi (pid=4122, process='fb_bot', application='vkc-sandbox02.kcell.kz|'): Loading WSGI script '/home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py'.
[Wed Aug 17 16:06:50.946329 2016] [wsgi:error] [pid 4010] [client 10.10.165.20:57995] Truncated or oversized response headers received from daemon process 'fb_bot': /home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py, referer: http://192.168.216.172/fb_nanosemantics/bot
[Wed Aug 17 16:06:51.654933 2016] [wsgi:info] [pid 4152] mod_wsgi (pid=4152): Attach interpreter ''.
[Wed Aug 17 16:06:51.655496 2016] [wsgi:info] [pid 4152] mod_wsgi (pid=4152): Adding '/home/user01/nano_fb_py_bot' to path.
[Wed Aug 17 16:06:51.656096 2016] [wsgi:info] [pid 4152] mod_wsgi (pid=4152): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/bin' to path.
[Wed Aug 17 16:06:51.656909 2016] [wsgi:info] [pid 4152] mod_wsgi (pid=4152): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages' to path.
[Wed Aug 17 16:06:51.693079 2016] [wsgi:info] [pid 4152] mod_wsgi (pid=4152): Imported 'mod_wsgi'.
[Wed Aug 17 16:06:51.694273 2016] [wsgi:debug] [pid 4152] src/server/mod_wsgi.c(8706): mod_wsgi (pid=4152): Started thread 1 in daemon process 'fb_bot'.
[Wed Aug 17 16:06:51.694314 2016] [wsgi:debug] [pid 4152] src/server/mod_wsgi.c(8706): mod_wsgi (pid=4152): Started thread 2 in daemon process 'fb_bot'.
[Wed Aug 17 16:06:51.694263 2016] [wsgi:debug] [pid 4152] src/server/mod_wsgi.c(8706): mod_wsgi (pid=4152): Started thread 0 in daemon process 'fb_bot'.

Graham Dumpleton

unread,
Aug 17, 2016, 6:54:05 AM8/17/16
to mod...@googlegroups.com
The process is crashing, likely because of a fault C extension module. Try adding:

    WSGIApplicationGroup %{GLOBAL}

See:


Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Anatoly Piskunov

unread,
Aug 17, 2016, 7:03:48 AM8/17/16
to modwsgi
Graham Dumpleton! My best complements, regards, blessing and other stuff!!!
That worked, i'll be testing this solution for now.

and again, thanks a lot!

среда, 17 августа 2016 г., 16:54:05 UTC+6 пользователь Graham Dumpleton написал:
Message has been deleted

Anatoly Piskunov

unread,
Aug 25, 2016, 1:37:33 AM8/25/16
to modwsgi
Hello again!

i've faced with another related problem, and rely on your competent help only!

recently, i've been posting my app. And when somebody calls my url, gets "ERR_CONTENT_DECODING_FAILED" or curl_err:23
so i added SetEnv no-gzip 1 into my VirtualHost Directory.
it now looks like:
        <Directory /home/user01/nano_fb_py_bot/nano_fb_py_bot>
        SetEnv no-gzip 1
        
<Files wsgi.py>

        Require all granted
        
</Files>
        
</Directory>
funny thing is, when now somebody requests url, he gets


%valid_response_string%<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
webmaster@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at kcl16bt08.kcell.kz Port 443</address>
</body></html>

in the apache log i see the same Truncated or oversized response headers received from daemon process

any ideas on that Graham?

Anatoly Piskunov

unread,
Aug 25, 2016, 2:18:24 AM8/25/16
to modwsgi
May be it's important, before i added SetEnv no-gzip 1 , i saw in apache logs that request is reaching the server, and response is sent back with no errors.
some users was even able to see correct response, but some got curl_error = Error while processing content unencoding: invalid block type or ERR_CONTENT_DECODING_FAILED.

so i dig for that problem, and found out about gzip issue.


четверг, 25 августа 2016 г., 11:37:33 UTC+6 пользователь Anatoly Piskunov написал:

Anatoly Piskunov

unread,
Aug 25, 2016, 2:28:17 AM8/25/16
to modwsgi
...and maybe i should just use --compress-responses instead no-gzip, but i haven't figured out how(

Graham Dumpleton

unread,
Aug 25, 2016, 2:33:09 AM8/25/16
to mod...@googlegroups.com

On 25 Aug 2016, at 4:28 PM, Anatoly Piskunov <piskuno...@gmail.com> wrote:

...and maybe i should just use --compress-responses instead no-gzip, but i haven't figured out how(

The —compress-responses option is something to do with mod_wsgi-express, which you aren’t using.

In mod_wsgi-express what that option does is ensure the mod_deflate is loaded and adds:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/javascript

You seem to want to turn off gzip, not turn it on.

Graham

Graham Dumpleton

unread,
Aug 25, 2016, 2:39:39 AM8/25/16
to mod...@googlegroups.com
Rather than set:

SetEnv no-gzip 1 

what happens when you disable mod_deflate altogether? That would turn off compression inbound and outbound for the whole server.

Understand if you can’t disable it for other reasons.

Graham

Anatoly Piskunov

unread,
Aug 25, 2016, 2:50:39 AM8/25/16
to modwsgi
I've just tried. Nothing changed

четверг, 25 августа 2016 г., 12:39:39 UTC+6 пользователь Graham Dumpleton написал:

Graham Dumpleton

unread,
Aug 25, 2016, 2:56:43 AM8/25/16
to mod...@googlegroups.com
As in the mod_wsgi daemon process crashed and you got the truncated response error, or you are getting the error from the HTTP client?

Can you ensure that LogLevel in Apache is set to ‘info’ and not just ‘warn’.

This will cause mod_wsgi to output log messages about daemon process stopping and starting. I would like to see what these message say at the time you see the truncated response message.

Thanks.

Graham

Anatoly Piskunov

unread,
Aug 25, 2016, 4:57:08 AM8/25/16
to modwsgi
truncated response error - is in the apache log for my virtualhost
In the HTTP Client (e.g. Chrome) - i see html output, it's source code below ("hubChallenge" string - is a valid plain text response on requested url. somehow HTML Error 500 page is appended)
hubChallenge<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1><p>The server encountered an internal error ormisconfiguration and was unable to completeyour request.</p><p>Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.</p><p>More information about this error may be availablein the server error log.</p><hr><address>Apache/2.4.7 (Ubuntu) Server at kcl16bt08.kcell.kz Port 443</address></body></html>

Log level is set to debug for wsgi. I've performed apache start, and requested url:

[Thu Aug 25 14:53:21.089973 2016] [ssl:info] [pid 21811] AH02200: Loading certificate & private key of SSL-aware server 'kcl16bt08.kcell.kz:443'
[Thu Aug 25 14:53:21.090341 2016] [ssl:info] [pid 21811] AH01914: Configuring server kcl16bt08.kcell.kz:443 for SSL protocol
[Thu Aug 25 14:53:21.255183 2016] [ssl:info] [pid 21812] AH02200: Loading certificate & private key of SSL-aware server 'kcl16bt08.kcell.kz:443'
[Thu Aug 25 14:53:21.256078 2016] [ssl:info] [pid 21812] AH01914: Configuring server kcl16bt08.kcell.kz:443 for SSL protocol
[Thu Aug 25 14:53:21.449452 2016] [wsgi:info] [pid 21816] mod_wsgi (pid=21816): Attach interpreter ''.
[Thu Aug 25 14:53:21.450022 2016] [wsgi:info] [pid 21816] mod_wsgi (pid=21816): Adding '/home/user01/nano_fb_py_bot' to path.
[Thu Aug 25 14:53:21.450706 2016] [wsgi:info] [pid 21816] mod_wsgi (pid=21816): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/bin' to path.
[Thu Aug 25 14:53:21.451438 2016] [wsgi:info] [pid 21816] mod_wsgi (pid=21816): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages' to path.
[Thu Aug 25 14:53:21.487378 2016] [wsgi:info] [pid 21816] mod_wsgi (pid=21816): Imported 'mod_wsgi'.
[Thu Aug 25 14:53:21.488570 2016] [wsgi:debug] [pid 21816] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21816): Started thread 2 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:21.488730 2016] [wsgi:debug] [pid 21816] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21816): Started thread 3 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:21.488805 2016] [wsgi:debug] [pid 21816] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21816): Started thread 1 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:21.488892 2016] [wsgi:debug] [pid 21816] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21816): Started thread 0 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:21.488980 2016] [wsgi:debug] [pid 21816] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21816): Started thread 4 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:42.025878 2016] [ssl:info] [pid 21817] [client 172.16.202.31:63658] AH01964: Connection to child 0 established (server kcl16bt08.kcell.kz:443)
[Thu Aug 25 14:53:42.042454 2016] [wsgi:info] [pid 21816] [remote 172.16.202.31:63658] mod_wsgi (pid=21816, process='fb_bot', application=''): Loading WSGI script '/home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py'.
[Thu Aug 25 14:53:42.952338 2016] [ssl:info] [pid 21835] [client 172.16.202.31:10193] AH01964: Connection to child 8 established (server kcl16bt08.kcell.kz:443)
[Thu Aug 25 14:53:43.456475 2016] [wsgi:info] [pid 21839] mod_wsgi (pid=21839): Attach interpreter ''.
[Thu Aug 25 14:53:43.456761 2016] [wsgi:info] [pid 21839] mod_wsgi (pid=21839): Adding '/home/user01/nano_fb_py_bot' to path.
[Thu Aug 25 14:53:43.457157 2016] [wsgi:info] [pid 21839] mod_wsgi (pid=21839): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/bin' to path.
[Thu Aug 25 14:53:43.457518 2016] [wsgi:info] [pid 21839] mod_wsgi (pid=21839): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages' to path.
[Thu Aug 25 14:53:43.475090 2016] [wsgi:info] [pid 21839] mod_wsgi (pid=21839): Imported 'mod_wsgi'.
[Thu Aug 25 14:53:43.475388 2016] [wsgi:debug] [pid 21839] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21839): Started thread 0 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:43.475441 2016] [wsgi:debug] [pid 21839] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21839): Started thread 1 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:43.475696 2016] [wsgi:debug] [pid 21839] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21839): Started thread 2 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:43.475780 2016] [wsgi:debug] [pid 21839] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21839): Started thread 3 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:43.476081 2016] [wsgi:debug] [pid 21839] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21839): Started thread 4 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:43.476238 2016] [wsgi:info] [pid 21839] [remote 172.16.202.31:10193] mod_wsgi (pid=21839, process='fb_bot', application=''): Loading WSGI script '/home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py'.
[Thu Aug 25 14:53:44.125366 2016] [wsgi:error] [pid 21835] [client 172.16.202.31:10193] Truncated or oversized response headers received from daemon process 'fb_bot': /home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py, referer: https://kcl16bt08.kcell.kz/fb_nanosemantics/bot/?hub.verify_tokn=token&hub.challnge=hub
[Thu Aug 25 14:53:44.461167 2016] [wsgi:info] [pid 21849] mod_wsgi (pid=21849): Attach interpreter ''.
[Thu Aug 25 14:53:44.461420 2016] [wsgi:info] [pid 21849] mod_wsgi (pid=21849): Adding '/home/user01/nano_fb_py_bot' to path.
[Thu Aug 25 14:53:44.461767 2016] [wsgi:info] [pid 21849] mod_wsgi (pid=21849): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/bin' to path.
[Thu Aug 25 14:53:44.462090 2016] [wsgi:info] [pid 21849] mod_wsgi (pid=21849): Adding '/home/user01/.virtualenvs/dev_fbbot_ve/lib/python3.4/site-packages' to path.
[Thu Aug 25 14:53:44.480225 2016] [wsgi:info] [pid 21849] mod_wsgi (pid=21849): Imported 'mod_wsgi'.
[Thu Aug 25 14:53:44.480470 2016] [wsgi:debug] [pid 21849] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21849): Started thread 0 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:44.480593 2016] [wsgi:debug] [pid 21849] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21849): Started thread 1 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:44.480688 2016] [wsgi:debug] [pid 21849] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21849): Started thread 2 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:44.480782 2016] [wsgi:debug] [pid 21849] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21849): Started thread 3 in daemon process 'fb_bot'.
[Thu Aug 25 14:53:44.481058 2016] [wsgi:debug] [pid 21849] src/server/mod_wsgi.c(8706): mod_wsgi (pid=21849): Started thread 4 in daemon process 'fb_bot'.

четверг, 25 августа 2016 г., 12:56:43 UTC+6 пользователь Graham Dumpleton написал:

Graham Dumpleton

unread,
Aug 25, 2016, 5:48:38 AM8/25/16
to mod...@googlegroups.com
There is no indication that the daemon process crashed, so it may well be the case that the response headers returned have values which are too long. This can happen when using fancy authentication challenge headers. They would need to be more than 8192 characters if using recent mod_wsgi versions.

What version of mod_wsgi are you using?

If using a recent version you could set the header-buffer-size option on WSGIDaemonProcess to increase allowed header size, but maybe first you can explain if there would be any strange headers your response returns, including authentication headers.

Graham

Anatoly Piskunov

unread,
Aug 25, 2016, 7:04:39 AM8/25/16
to modwsgi
mod_wsgi ver. 4.5.4
header-buffer-size=32768 in WSGDaemonProcess

Here is output of incoming WSGIRequests.META dictionary

{'mod_wsgi.daemon_connects': '1',
'wsgi.file_wrapper': ,
'wsgi.input': ,
'mod_wsgi.total_requests': 0,
'mod_wsgi.script_start':
'1472121938672714',
'HTTP_CONNECTION': 'close',
'CONTEXT_DOCUMENT_ROOT': '/var/www/html',
'HTTP_HOST': 'kcl16bt08.kcell.kz',
'wsgi.url_scheme': 'https',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.version': (4, 5, 4),
'mod_wsgi.daemon_start': '1472121937833037',
'HTTP_X_FORWARDED_HOST': 'kcl16bt08.kcell.kz',
'HTTP_X_FORWARDED_FOR': '2.73.22.35',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate, sdch, br',
'mod_wsgi.process_group': 'fb_bot',
'SERVER_SOFTWARE': 'Apache/2.4.7 (Ubuntu)',
'mod_wsgi.path_info': '/fb_nanosemantics/bot/',
'mod_wsgi.application_group': '',
'DOCUMENT_ROOT': '/var/www/html',
'QUERY_STRING': 'hub.verify_token=kcl16bt08Anatoliy&hub.challenge=hubChallenge',
'SERVER_PROTOCOL': 'HTTP/1.0',
'mod_wsgi.thread_id': 1,
'HTTP_X_FORWARDED_SERVER': 'kcl16bt08.kcell.kz',
'wsgi.errors': <_io.TextIOWrapper encoding='utf-8'>,
'mod_wsgi.request_id': 'kakrGUOH218',
'REQUEST_METHOD': 'GET',
'mod_wsgi.daemon_restarts': '0',
'SERVER_ADDR': '192.168.216.172',
'HTTP_CACHE_CONTROL': 'max-age=0',
'HTTP_X_REAL_IP': '2.73.22.35',
'PATH_INFO': '/fb_nanosemantics/bot/',
'SERVER_ADMIN': 'webmaster@localhost',
'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
'REQUEST_URI': '/fb_nanosemantics/bot/?hub.verify_token=kcl16bt08Anatoliy&hub.challenge=hubChallenge',
'mod_wsgi.queue_start': '1472121937832612',
'mod_wsgi.script_name': '',
'mod_wsgi.request_handler': 'wsgi-script',
'PATH_TRANSLATED': '/home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py/fb_nanosemantics/bot/',
'mod_wsgi.listener_port': '443',
'wsgi.multiprocess': False,
'mod_wsgi.listener_host': '',
'mod_wsgi.connection_id': 'rqArGUOH218',
'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
'HTTP_X_FORWARDED_PROTO': 'https',
'wsgi.version': (1, 0),
'mod_wsgi.script_reloading': '1',
'wsgi.multithread': True,
'mod_wsgi.handler_script': '',
'mod_wsgi.thread_requests': 0,
'SERVER_SIGNATURE': 'Apache/2.4.7 (Ubuntu) Server at kcl16bt08.kcell.kz Port 443\n',
'REMOTE_PORT': '41533',
'HTTP_COOKIE': '__utma=138954921.950862559.1469675440.1472009648.1472012630.3; __utmz=138954921.1469675440.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
'LD_LIBRARY_PATH': '/usr/lib/oracle/12.1/client64/lib/',
'mod_wsgi.request_start': '1472121937832337',
'wsgi.run_once': False, 'SERVER_PORT': '443',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Linux; Android 5.1.1; Redmi Note 3 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36',
'SERVER_NAME': 'kcl16bt08.kcell.kz',
'GATEWAY_INTERFACE': 'CGI/1.1',
'REQUEST_SCHEME': 'https',
'mod_wsgi.enable_sendfile': '0',
'CONTEXT_PREFIX': '',
'SCRIPT_FILENAME': '/home/user01/nano_fb_py_bot/nano_fb_py_bot/wsgi.py',
'REMOTE_ADDR': '172.16.202.31',
'SCRIPT_NAME': '',
'apache.version': (2, 4, 7)}

as a response on that - i use return HttpResponse(%plain_text_variable%)
HttpResponse imported from django.http.response

Chrome dev.tools also got me this.

Response Headers
    1. HTTP/1.1 200 OK Server: nginx/1.8.0 Date: Thu, 25 Aug 2016 11:02:35 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding X-Frame-Options: SAMEORIGIN Access-Control-Allow-Origin: * Content-Encoding: gzip
  1. Request Headersview source
    1. Accept:
      text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    2. Accept-Encoding:
      gzip, deflate, sdch, br
    3. Accept-Language:
      en-US,en;q=0.8
    4. Cache-Control:
      max-age=0
    5. Connection:
      keep-alive
    6. Host:
    7. Upgrade-Insecure-Requests:
      1
    8. User-Agent:
      Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36


четверг, 25 августа 2016 г., 15:48:38 UTC+6 пользователь Graham Dumpleton написал:
Reply all
Reply to author
Forward
0 new messages