Yesterday we decided to resize our droplet. Before that, everything was running fine. Our Node/Express server was up, and we could connect to it.
After resizing it. We could no longer fetch from the server, even though the application is 100% running, I’ve checked many times, via pm2. Logs are being printed out constantly.
I’ve read countless threads and tried countless solutions, none that worked so far. Port seems fine. Firewalls are disabled.
The 2 errors we are getting are net::ERR_CONNECTION_REFUSED and TypeError: Failed to fetch.
The application runs fine on localhost, just not on the droplet. Would appreciate any help. If there’s any further information needed please let me know.
Edit: Not sure how relevant, but I ran “service nginx status” and got the following:
● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-01-03 21:00:38 UTC; 13h ago Docs: man:nginx(8) Process: 903 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Jan 03 21:00:37 glorious-nexus-api systemd[1]: Starting A high performance web server and a reverse proxy server… Jan 03 21:00:37 glorious-nexus-api nginx[903]: nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log” failed Jan 03 21:00:38 glorious-nexus-api nginx[903]: 2024/01/03 21:00:37 [emerg] 903#903: open() “/var/log/nginx/access.log” failed (2: No Jan 03 21:00:38 glorious-nexus-api nginx[903]: nginx: configuration file /etc/nginx/nginx.conf test failed Jan 03 21:00:38 glorious-nexus-api systemd[1]: nginx.service: Control process exited, code=exited status=1 Jan 03 21:00:38 glorious-nexus-api systemd[1]: nginx.service: Failed with result ‘exit-code’. Jan 03 21:00:38 glorious-nexus-api systemd[1]: Failed to start A high performance web server and a reverse proxy server.
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!
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.
Hi there,
As far as I can tell from the output, the primary issue seems to be with Nginx, as indicated by the failed status in your
service nginx status
command.The logs suggest problems with accessing the log files (
/var/log/nginx/error.log
and/var/log/nginx/access.log
). This could be due to permission issues or missing directories/files./var/log/nginx/
directory exists and has the correct permissions. You can recreate it and set appropriate permissions using commands likesudo mkdir -p /var/log/nginx/
andsudo chown -R www-data:www-data /var/log/nginx/
.sudo systemctl restart nginx
and try again.Let me know how it goes!
Best,
Bobby