Python – Centos7 mod_wsgi python3 django timeout error 504 Gateway error

apache-2.4httpdmod-wsgipython

I have been using apache for a django project. I need to upload a very large file in application. But I am getting Gateway timeout error 504.

I am using Centos7, httpd2.4, mos_wsgi, python3.48

#myapp.conf

Alias /static /opt/grameenphone-torque/static
<Directory /opt/grameenphone-torque/static>
 Require all granted
</Directory>

<Directory /opt/grameenphone-torque/xcg_is>
   <Files wsgi.py>
       Require all granted
   </Files>
</Directory>

WSGIDaemonProcess xcg_is python-path=/opt/grameenphone-torque:/opt/grameenphone-torque/env/lib/python3.4/site-packages request-timeout=6000 connect-timeout=6000 queue-timeout=6000
WSGIProcessGroup xcg_is
WSGIScriptAlias / /opt/grameenphone-torque/xcg_is/wsgi.py

Best Answer

Just add needed TimeOut to your VirtualHost section. https://httpd.apache.org/docs/2.4/en/mod/core.html#timeout. Like:

<VirtualHost *:443>
    AllowEncodedSlashes On
    ....
    TimeOut 600
    ....

Cause default is exactly 60 seconds