By chrisDolphin
Hi there,
Im having a problem with proxy on apache, when i run my app and upload several images i get no error but when using bigger files such as .mp4 files (50mb), the first files upload without a problem but then if it’s several files I get:
ERR_ABORTED 502 (Proxy Error)
My config file for my domain is:
ServerAdmin info@domain.net
DocumentRoot /var/www/domain.net/public_html
ServerName domain.net
ServerAlias www.domain.net
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:3002/
Alias /error/ “/var/www/domain.net/public_html/error/”
ProxyPass /error/ !
ErrorDocument 503 /error/503.html
ProxyPassReverse / http://127.0.0.1:3002/
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3002/$1 [P,L]
<Directory /var/www/domain.net/public_html/>
Options FollowSymLinks
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorDocument 503 /50x.html
<Files "50x.html">
<If "-z %{ENV:REDIRECT_STATUS}">
RedirectMatch 404 ^/50x.html$
</If>
</Files>
Any ideas or help? Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
The 502 Proxy Error means that the proxy server, in your case Apache, received an invalid response from an upstream server it accessed to fulfill the request. This could be happening for a number of reasons.
ProxyPass / http://127.0.0.1:3002/ timeout=600
ProxyPassReverse / http://127.0.0.1:3002/
Here, the timeout is set to 600 seconds (10 minutes). You may adjust this to fit your needs.
Client Maximum Body Size: Ensure that the file size of your uploads doesn’t exceed the configured maximum size limit.
Check Your Application Server: Make sure that your Node.js server is not crashing or becoming unresponsive when you’re uploading large files. Look at the logs for your Node.js server to see if there are any error messages.
Check Apache and System Logs: Inspect the Apache error log file located typically in /var/log/apache2/error.log (or as defined in your configuration) and system logs in /var/log/syslog for any indications of what might be causing the 502 error.
Use Mod_reqtimeout Module: The Apache mod_reqtimeout module allows you to control the timeout based on the bytes transferred over the time rather than an absolute time since the request started. You can enable this module with a2enmod reqtimeout and then configure the timeouts with the RequestReadTimeout directive.
Remember to restart your Apache server after making any changes to the configuration:
sudo systemctl restart apache2
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.