我一直在为一个 django 项目使用 apache。我需要在应用程序中上传一个非常大的文件。但我收到了网关超时错误 504。
我正在使用 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
答案1
只需将所需的 TimeOut 添加到您的 VirtualHost 部分即可。 https://httpd.apache.org/docs/2.4/en/mod/core.html#timeout。 喜欢:
<VirtualHost *:443>
AllowEncodedSlashes On
....
TimeOut 600
....
因为默认值正好是 60 秒