ERR_CONNECTION_REFUSED means nothing accepted a TCP connection on the address and port in your URL. Fix it by checking, in order: the exact URL and port, DNS, the service process, its listening socket and bind address, NGINX or Apache configuration, logs, port conflicts, and external firewall rules. A service listening on 8080 cannot answer a request sent to port 80 unless another listener or proxy accepts traffic on port 80.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What ERR_CONNECTION_REFUSED actually tells you
Your browser reached an address but the TCP connection was rejected instead of being accepted by a web server or application. The error does not identify whether the cause is a stopped process, the wrong port, a loopback-only bind, a bad proxy target, a port conflict, or a firewall policy. It does tell you where to begin: verify the listener for the exact address and port in the request.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Do not start by changing DNS, reinstalling a web server, or editing several configuration files at once. Preserve a known state, collect evidence, and change one layer at a time.
Use this diagnostic order
- Copy the URL and record its scheme, hostname, resolved address, and explicit or implied port.
- Resolve the hostname and confirm that it points to this server.
- Check whether the intended process is running and whether a socket is listening on that address and port.
- Inspect the web-server binding and virtual-host or server-block configuration.
- Read the error log before making more changes.
- Validate the configuration and reload or restart the service.
- Check for an occupied port or insufficient privilege.
- Test from another network, then investigate host firewalls, cloud security groups, network ACLs, routing, and public-interface binding if local tests work.
1. Read the URL literally
Write down every part of the failing address. http://example.test normally means port 80; https://example.test normally means port 443. A URL such as http://example.test:8080 explicitly requests port 8080. The scheme also matters: an HTTP listener cannot complete an HTTPS handshake merely because both use the same hostname.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
| Value | What to verify | Typical mistake |
|---|---|---|
| Scheme | Whether the service expects HTTP or HTTPS | Sending HTTPS to an HTTP-only development listener |
| Hostname | The name you intended to use | A typo or an old subdomain |
| Port | The explicit port, or 80/443 when omitted | Application listens on 8080 while the browser requests 80 |
| Address family | Whether the name resolves to IPv4, IPv6, or both | Service listens on one family while the client tries the other |
Test the exact port directly rather than relying only on the browser:
curl -v http://127.0.0.1:8080/
curl -v http://your-hostname.example:8080/
Replace the address and port with the values in your URL. A local request to 127.0.0.1 checks the process on the host; it does not prove that remote clients can reach it.
Free tools Windows power users keep installed
One-click scans. No signup required.
2. Check DNS before changing web-server settings
The hostname must resolve to the intended server. Apache’s documentation specifically treats DNS resolution as a prerequisite for reachability. Compare the returned addresses with the server’s public or private addresses.
dig +short your-hostname.example
getent hosts your-hostname.example
nslookup your-hostname.example
Use the command available on your system. If the name returns an old address, a different machine, or no address, correct the DNS record or use the server’s known address for a controlled test. If DNS returns both IPv4 and IPv6, test each address explicitly; a listener bound only to IPv4 will not accept a connection sent to its IPv6 address.
DNS correction does not make a stopped service reachable. Recheck the listener after the name resolves correctly.
3. Confirm the process and socket listener
Linux: service state
On a systemd-based Linux host, inspect the service that should answer the request. Distribution names vary, so use the unit installed on your machine.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo systemctl status nginx
sudo systemctl status apache2
sudo systemctl status httpd
A failed, inactive, or repeatedly restarting unit explains a refusal. Read the status output and recent journal entries before restarting:
sudo journalctl -u nginx -n 100 --no-pager
sudo journalctl -u apache2 -n 100 --no-pager
sudo journalctl -u httpd -n 100 --no-pager
Find the listening address and port
Check the kernel’s socket table, not merely the process list:
sudo ss -ltnp
sudo lsof -nP -iTCP:80 -sTCP:LISTEN
sudo lsof -nP -iTCP:443 -sTCP:LISTEN
Look for the requested port and note the bind address. A listener on 127.0.0.1:8080 accepts connections from the same host but normally refuses remote clients. A listener on 0.0.0.0:8080 is bound to all IPv4 interfaces; an IPv6-only listener is shown with an IPv6 address and may not serve IPv4 clients.
Windows: service and socket checks
On Windows, inspect the service in Services or PowerShell, then list listeners:
Get-NetTCPConnection -State Listen
netstat -ano | findstr LISTENING
Map a PID from the output to the expected web-server process. An unexpected PID on the required port indicates a conflict rather than a browser problem.
4. Check NGINX binding and request matching
NGINX’s listen directive specifies the IP address and port, or a Unix socket, where a server block accepts connections. A minimal block must listen on the port receiving traffic. The official beginner example uses listen 127.0.0.1:8080;; omitting the address makes NGINX listen on all addresses, while an omitted port uses the standard default for the context.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
server {
listen 80;
server_name your-hostname.example;
root /var/www/site;
}
Inspect the active configuration, including files included by the main configuration:
sudo nginx -T
Check three related settings:
listen: matches the address and port that clients actually use.server_name: matches the Host header sent by the client.proxy_pass: points to an application that is actually listening at the upstream address and port.
NGINX first selects a server block by the request IP and port, then uses the Host header. If no server name matches, it serves the default server for that port. Therefore, a wrong hostname usually selects the wrong site; a missing or incorrectly bound listen directive prevents a connection from being accepted at all.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Validate before applying an NGINX change
sudo nginx -t
sudo nginx -s reload
Reload only after the syntax test succeeds. NGINX configuration changes do not take effect until a reload or restart. If the reload fails, keep the previous working configuration and read the error output and NGINX error log instead of repeatedly restarting.
Reverse-proxy check
A common arrangement is a public NGINX listener forwarding to an application:
location / {
proxy_pass http://localhost:8080;
}
Test the upstream locally on the same host:
curl -v http://127.0.0.1:8080/
If that connection is refused, NGINX may be healthy while the application behind it is stopped, listening on another port, or bound to a different interface. If the upstream works locally but the public URL is refused, return to NGINX’s public listen directive and external firewall checks.
5. Check Apache binding and virtual hosts
Apache’s Listen directive determines the addresses and ports it accepts. A <VirtualHost> block does not create a listener by itself; Apache must already be listening on the matching address and port.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Listen 80
<VirtualHost *:80>
ServerName your-hostname.example
DocumentRoot /var/www/site
</VirtualHost>
Compare the Listen address and port with the socket listing. Then verify that the virtual host uses the same port. A virtual host on *:443 cannot answer an HTTP request sent to port 80 unless another configuration handles that request.
Validate Apache before restarting
sudo apachectl configtest
sudo systemctl reload apache2
sudo systemctl reload httpd
Use the service name and command supplied by your distribution. Apache reports fatal startup failures to the console or its configured ErrorLog. If startup fails, do not assume the old configuration is still active; check the service status and socket table.
6. Read logs before changing more settings
Logs distinguish a stopped process from a routing or binding error. Apache describes its log files, particularly the error log, as an administrator’s most valuable assets. NGINX uses access.log and error.log to show received requests and configuration or upstream failures.
- No access-log entry: the request may not be reaching that web-server listener; inspect DNS, the requested port, routing, and firewalls.
- Startup or syntax error: fix the named directive, missing file, permission problem, or invalid include before reloading.
- Bind error: another process may own the port, or the service may lack permission for the requested address or privileged port.
- Upstream connection refused: the reverse-proxied application is not accepting connections at the configured upstream address and port.
On systemd hosts, combine service-specific logs with the web server’s configured log paths:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallsudo journalctl -u nginx -f
sudo journalctl -u apache2 -f
sudo journalctl -u httpd -f
In another terminal, make one test request and watch which log changes. This ties the symptom to the layer that handled it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.7. Resolve port conflicts and permission failures
Only one process can normally bind the same address and TCP port. Apache documents “Unable to bind to Port …” as commonly caused by insufficient rights on a privileged port or another web server already using it. Overlapping Apache Listen directives are fatal.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
- Identify the owner:
sudo ss -ltnporsudo lsof -nP -iTCP:80 -sTCP:LISTEN. - Decide which service should own the port. Do not stop an unknown process until you understand its role.
- Remove duplicate
Listendirectives or change one service to an unused port. - Validate the configuration, then reload or restart the selected service.
- Retest the exact URL and confirm the expected PID is listening.
Ports below 1024 generally require elevated privileges on Unix-like systems. Run the service through its supported service manager rather than granting broad permissions to an application simply to make a bind succeed.
8. Separate local, host, and external failures
| Result | Most likely area | Next check |
|---|---|---|
| Local request to the service port is refused | Process, port, bind address, or local configuration | Service status, socket table, logs, and NGINX/Apache binding |
| Local request works, public hostname is refused from the same host | DNS destination, address family, virtual host, or local firewall path | Resolve the hostname, test each address, and inspect the public listener |
| Local and same-network requests work, external request is refused | Host firewall, cloud security group, network ACL, routing, or public-interface binding | Test from an external network and check provider and host rules |
| Public listener works but proxy URL fails | Upstream application or proxy_pass target |
Curl the upstream locally and read the proxy error log |
From a separate network, test the exact public port. A phone hotspot is useful when the server and client otherwise share the same LAN. If outside traffic is refused while the process listens locally, verify that the operating-system firewall, cloud security group, network ACL, and router forwarding all permit that TCP port. Also confirm that the service is bound to a public interface rather than only to loopback.
Do not open additional ports indiscriminately. Permit only the ports required by the intended service, and keep administrative ports restricted according to your hosting environment.
9. Apply changes safely and recover
Make one change, validate it, reload the service, and run the same test again. Save a copy of the working configuration before editing. If a reload reports an error, restore the last known-good file and validate it before attempting another reload.
- Record the failing URL, resolved addresses, listener output, service status, and relevant log lines.
- Change the smallest setting that explains the evidence: a port, bind address, server name, upstream target, or firewall rule.
- Run the web server’s configuration test.
- Reload rather than restarting when the server supports a safe reload.
- Check that the expected socket remains present and that a test request reaches the expected log.
- Repeat from an external network after local success.
A restart can hide the original evidence and may create downtime. Use it only when the service requires a restart or remains unhealthy after a successful configuration reload.
Prevent the next refusal
- Document the public URL, internal application port, and which process owns each listener.
- Keep NGINX
listen,server_name, andproxy_passvalues together in your deployment notes. - Keep Apache
Listenand<VirtualHost>ports aligned. - After deployments, test from the host and from an external network.
- Monitor service state and error logs so a crash loop is visible before users report a refusal.
- Remove obsolete listeners and duplicate configuration entries.
When the refusal persists
Collect four artifacts for whoever administers the host: the literal URL, DNS output, the process/socket listing, and the relevant service error-log lines. Add the result of one local test and one external test. That evidence identifies whether the failure is before the web server, at its listener, or between the proxy and application, without guessing at unrelated settings.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsQuick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




