How to fix API 500 internal server error - ubuntu droplet

Posted October 4, 2021 70 views
ApacheAPIDeploymentInitial Server SetupUbuntu 20.04DigitalOcean Droplets

I just deployed my .net 5.0 app to ubuntu Droplet, in which Apache proxy was configured by run below commands without any issue:

a2enmod proxy proxyhttp proxyhtml rewrite
systemctl restart apache2
sudo ufw allow ‘Apache Full’

When visit my site, all the static content display properly. However, there is issue to access API controllers and thus failed retrieving data.

Error Info from server journalctl:
Request finished HTTP/1.1 GET http://myIp/api/ads/adsImage/images - - - 500 - application/json 7.7037ms

Error from my client:
“Http failure response for http://myIp/api/ads/adsImage/images: 500 Internal Server Error”

Is this issue related to proxy or CORS or my code? Local testing was absolutely successful.

How should I to figure it out?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @gdliu,

Usually, the 500 Internal Server Error is connected with some misconfiguration on either your Apache config file or your .htaccess.

The best solution would be to check your Apache error_log in /var/log/apache2. In there (in the log), you should be able to see the exact reason behind the 500 error and correct it.


  • Thanks for pointing this out. I checked Apache error log and found these errors:
    [proxy_http:error] [pid 34211:tid 140143541335808] (20014)Internal error (specific information not available): [client] AH01102: error reading status line from remote server>

    [proxy:error] [pid 34211:tid 140143541335808] [client] AH00898: Error reading from remote server returned by /server-error

    [proxy:error] [pid 34211:tid 140143432230656] (111)Connection refused: AH00957: HTTP: attempt to connect to ( failed

    [proxy_http:error] [pid 34211:tid 140143432230656] [client] AH01114: HTTP: failed to make connection to backend:,

    Can you please provide further help?