Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →A Dokku 502 Bad Gateway usually means nginx cannot reach a healthy web process for your app. Fix the failing layer in this order: confirm that a web process exists and stays running, read the app’s nginx error log, verify the host-to-container port map, confirm that the application listens on the mapped port and on 0.0.0.0, validate and reload nginx, then check Ubuntu firewall rules. Restarting the app before correcting one of those conditions rarely solves the problem.
Antihost offers VPS plans with one-click Docker, NVMe storage and a 14-day free trial.
What a 502 means in Dokku
Dokku deliberately generates a minimal nginx configuration that returns 502 Bad Gateway when an app has been created but not deployed, has no web process type, or has no running web processes. A stopped app therefore needs process or application repair before proxy tuning.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
“when an app is created but not yet deployed, has no
webprocess type, or has no running web processes, Dokku generates a minimal nginx configuration that returns502 Bad Gatewayresponses.” — Dokku documentation, Nginx Proxy page.
This makes the status code useful: it identifies a failed connection between nginx and the app, not necessarily a problem with the browser or DNS. The exact cause can be a crashed process, a wrong port, a listener bound only to loopback, invalid generated nginx configuration, or a host firewall rule.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
A successful build or deployment message is not the same as a successful HTTP service. Dokku can finish building an image while the resulting web process exits immediately, listens on a different port, or never becomes reachable from the proxy. Treat the 502 as a layer-identification problem and collect evidence before changing several settings at once.
Start with process health
Replace APP in every command with the Dokku app name. Check both the process report and recent application output:
dokku ps:report APP
dokku logs APP --tail
The process report establishes whether Dokku has formed a web process and whether a container is currently running. The log stream shows why a container might stop between two checks. Run both checks close together, because a process that appears briefly in a report may exit before nginx receives the next request.
When no web process exists
A deployment needs a process type named web for HTTP traffic. If the report shows no running web process, inspect the application’s Procfile or process formation and redeploy after correcting it. A worker, release, or scheduled process cannot satisfy nginx’s web proxy. Adding or keeping a worker does not make it an HTTP upstream; the application must explicitly form a continuously running web process.
When the web process repeatedly exits
Read the application log for the first startup error rather than repeatedly restarting it. Common evidence includes a bad start command, a missing environment variable, a migration failure, or a bind error. Correct that application-level fault and deploy again. A restart is useful only after the process can start successfully; it cannot create a missing process type or repair a failing command.
Look for the earliest error in a restart loop. A later “connection refused” entry may only be a consequence of the process already having crashed. Preserve the original command, environment, and exit message while correcting the application, then verify that the process remains alive for more than one request.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →When the report says the app is healthy
Continue while reproducing the request. A process can be listed briefly and still exit before nginx connects, so compare the process report with the live logs and the nginx error log. Health at the moment of deployment does not prove that the process is healthy at the moment of the 502.
Read nginx’s evidence while reproducing the 502
Dokku exposes separate commands for the app’s nginx error log, access log, and generated configuration:
dokku nginx:error-logs APP -t
dokku nginx:access-logs APP
dokku nginx:show-config APP
The default per-app files are /var/log/nginx/APP-error.log and /var/log/nginx/APP-access.log. Run the error-log command, make one request that produces the 502, and read the newest entry. The message usually tells you which layer to inspect next. The access log confirms that the request reached nginx, while the generated configuration shows the upstream address and port that nginx is actually using.
Keep the request pattern consistent while testing. Make one request, note its time, then correlate that time with the newest access and error entries. This avoids attributing an older timeout or a different virtual host’s failure to the current change.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Connection refused
A refusal normally means nginx reached the container address but nothing is accepting connections on the configured port. Check whether the web process has exited, whether it is listening on a different port, and whether it bound to the correct interface. If the process report is healthy, verify the listener and port map before changing nginx timeouts.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Upstream timeout
A timeout indicates that the upstream did not answer within the proxy’s wait period. Check for a wedged or overloaded application, a startup operation that never completes, or a process that is alive but unable to serve requests. The nginx log is the evidence for choosing this branch; do not change the port map solely because the response is slow. A timeout and a refusal are different symptoms: one suggests a nonresponsive upstream, while the other suggests that no listener accepted the connection.
Address or port mismatch
An upstream address or port that does not match the container’s listener points to routing or image configuration. Compare the generated config with the port reported by Dokku and the port used by the application. If those values disagree, repair the mapping or server configuration first, then regenerate or reload only as required.
Verify and repair the Dokku port map
Display the mapping that nginx and Docker are using:
dokku ports:report APP
Compare the reported internal port with the port on which the web server actually listens. The public side in a typical HTTP mapping is port 80; the internal side must be the application’s real listening port. For an app that genuinely listens on port 5000, the documented repair pattern is:
dokku ports:set APP http:80:5000
Use the application’s real port instead of copying 5000 as a default. If the server listens on 8080, map http:80:8080; if it listens on another port, substitute that value. After changing the mapping, reproduce the request and watch the error log again.
A successful deploy does not prove that the mapping is correct. The image may have changed its listen port, a previous manual mapping may remain, or generated proxy settings may be stale. Treat ports:report as the authoritative starting point for the current Dokku mapping. Do not infer the internal port from the public URL: the public port and container port are separate values.
The mapping is a persistent deployment setting, whereas a one-off container restart is temporary. If a later deploy regenerates proxy configuration from image metadata or Dokku settings, a manual correction that was never recorded in the app’s port configuration can disappear. Recheck the report after redeploying.
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 errorsConfirm the container’s listener and bind address
The mapped port must have a running listener inside the container. Verify the application’s server configuration, startup output, and container state using the diagnostic facilities appropriate to your image. The important questions are:
- Is the web process still running when the request arrives?
- Does it listen on the same internal port shown by
dokku ports:report APP? - Does it bind to
0.0.0.0:<port>rather than only127.0.0.1:<port>?
Binding only to loopback can make an application appear healthy from inside its own process while remaining unreachable through Docker networking. Configure the framework or server to listen on the container’s external interface, then redeploy or restart the web process. The address and port must be correct at the same time; fixing only one still leaves nginx unable to connect.
Do not treat an open application socket inside the process as proof that the proxy can use it. A loopback-only listener accepts connections from the same container namespace but not from the Docker path nginx uses. Conversely, binding to the correct interface on an unlisted port still produces a 502.
Check Dockerfile exposure
If the image uses a Dockerfile, inspect its EXPOSE declaration and ensure it names the intended web port. Dokku documents that exposed ports can influence proxy configuration, but EXPOSE is not a substitute for a running listener. An image can advertise a port while the process listens elsewhere, and nginx will still return 502.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Keep three values aligned: the port advertised by the image, the port used by the application server, and the internal port in Dokku’s mapping. If the image metadata and the actual server disagree, use the logs and listener behavior to determine the real port, then make the deployment configuration consistent rather than relying on an advertisement alone.
Port, process, and bind failures are different
A process crash requires an application fix. A listener on the wrong port requires a mapping or server-port fix. A listener bound to loopback requires a bind-address fix. These faults can produce similar 502 responses, so use the process report, application log, port report, and nginx error text together instead of applying all changes at once.
Validate nginx before reloading
Do not reload a generated configuration that has not passed validation. Use the system-level check or Dokku’s per-app validator:
sudo nginx -t
dokku nginx:validate-config APP
Only after validation succeeds should you reload Dokku’s nginx configuration:
dokku nginx:reload
Validation and reload answer different questions. Validation checks whether nginx can parse and accept the configuration; reload activates the accepted configuration. Keeping those steps separate prevents an invalid generated file from replacing the last working configuration.
If dokku nginx:show-config APP reveals an obsolete upstream, missing server block, or other drift, inspect how your Dokku release rebuilds generated app configuration and run that release-specific rebuild command. The exact rebuild command varies by Dokku version, so do not substitute a command from an unrelated release. Validate again after rebuilding, then reload.
Interpret validation failures
An nginx syntax or include error is a configuration problem, not proof that the application is down. Repair the template, include, or generated app configuration identified by the validator. Keep the last known-good configuration active until the new one passes; an invalid reload must not become the next outage.
If validation succeeds but the error continues, return to the upstream evidence. A syntactically valid configuration can still point to the wrong internal port or to a process that has exited. Syntax validation is necessary, but it does not test application readiness.
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 reinstallCheck Ubuntu firewall and Docker reachability
Dokku’s troubleshooting guidance specifically identifies a host firewall such as UFW as a possible cause of Bad Gateway on Ubuntu. This branch is especially important when deployment reports success, the web process remains running, and the port map and listener agree.
Inspect the host’s UFW policy and any other firewall layer controlling Docker traffic. Public HTTP and HTTPS must be allowed to reach nginx, and host rules must not block the Docker/Dokku path between nginx and the app container. Change only the rule that explains the observed failure, then reproduce the request while following dokku nginx:error-logs APP -t.
A firewall adjustment should not replace application checks. If nginx logs show connection refusal and the container is not listening, opening another host port will not fix the process. Conversely, if the container is healthy but packets are blocked by host policy, restarting the app will not change the result.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Retest and isolate the failing layer
After one corrective change, make a direct HTTP request to the app’s hostname:
Free tools Windows power users keep installed
One-click scans. No signup required.
curl -I http://APP.example.com
Use the result together with the newest nginx log entry. A status change after starting the web process identifies process availability as the original fault. A change after ports:set identifies routing. A failed nginx validation identifies configuration. A refusal with a correct map sends you back to the container’s bind address, crash output, and health state.
Use one change per test
Changing the process command, port map, firewall, and nginx configuration simultaneously removes the evidence needed to know what worked. Record the command and result for each test, and keep the request pattern the same. This is faster than repeatedly redeploying without a hypothesis.
Prefer the smallest reversible change that tests the suspected layer. A process-definition correction belongs in the application and should be redeployed. A port correction belongs in Dokku’s port settings. A generated-config correction should be rebuilt with the command for the installed Dokku release. A firewall change should be limited to the policy that blocks the demonstrated HTTP, HTTPS, or Docker path.
Check after a redeploy
Some settings are regenerated during deployment. After a successful redeploy, confirm that the web process is still formed, the internal listen port has not changed, and the generated configuration still points to that port. A temporary manual correction can disappear when Dokku rebuilds the app’s proxy configuration.
Also repeat the error-log check after the redeploy. A new 502 may have a different cause than the original one: correcting a missing process can expose a port mismatch, and correcting a port can expose a loopback bind. Treat each new log entry as fresh evidence.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose the remedy by the failing layer
| Evidence | Layer | Corrective action | What makes it durable |
|---|---|---|---|
No web process or the app is stopped |
Process formation | Fix the Procfile or process definition and redeploy | A valid, continuously running web command |
| Web process exits with startup errors | Application startup | Fix the reported command, environment, migration, or bind failure | The application starts cleanly with required settings |
| Refusal on the mapped upstream | Listener | Start the server on the mapped port and bind to 0.0.0.0 |
Server and Dokku use the same internal port |
| Reported internal port differs from the server port | Port mapping | Set http:80:INTERNAL_PORT with the actual port |
Keep the mapping aligned with the image and deployment settings |
| Generated config is stale or fails validation | Nginx configuration | Rebuild using the command for your Dokku release, validate, then reload | Configuration generation remains correct after deployment |
| Healthy app and map, but host traffic is blocked | Ubuntu firewall | Adjust UFW or host policy so the nginx/Docker path is permitted | A persistent rule that matches the required HTTP/HTTPS path |
This comparison also indicates when a remedy must be repeated. Starting a stopped process may restore service immediately, but it is not durable if the Procfile still forms the wrong process. Setting the correct port is durable when it matches the image and deployment configuration, but it should be checked after a redeploy. Rebuilding and reloading nginx is appropriate only after the generated configuration reflects the corrected process and port state.
A complete repair sequence
- Run
dokku ps:report APPanddokku logs APP --tail. Establish whether a runningwebprocess exists and remains alive. - While making a failing request, run
dokku nginx:error-logs APP -t. Use refusal, timeout, or mismatch evidence to select the next check. - Run
dokku ports:report APP. Compare the internal mapping with the server’s actual listen port. - Correct a mismatch with
dokku ports:set APP http:80:INTERNAL_PORT, replacingINTERNAL_PORTwith the real value. - Confirm that the server binds to
0.0.0.0on that port and that any DockerfileEXPOSEdeclaration names the intended web port. - Inspect
dokku nginx:show-config APP. If it is stale, rebuild it with the command documented for your Dokku release. - Run
sudo nginx -tordokku nginx:validate-config APP. Reload only after validation succeeds withdokku nginx:reload. - If the deployment is healthy but requests still fail, inspect UFW and other host firewall rules for blocked HTTP, HTTPS, or Docker traffic.
- Run
curl -I http://APP.example.comand correlate the response with a fresh nginx error-log entry.
The final command and setting depend on your framework, Dokku version, Dockerfile or buildpack, internal listen port, and the exact nginx error text. When those values are unknown, branch on the observed evidence rather than applying an app-specific fix by guesswork.
Frequently asked questions
Why does Dokku return 502 immediately after an apparently successful deploy?
A build can succeed while the app has no running web process, exits during startup, listens on the wrong port, or binds only to loopback. Check dokku ps:report APP, dokku logs APP --tail, and the per-app nginx error log before restarting.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Is restarting the app enough to clear a Dokku 502?
Only when the underlying process was temporarily stopped and can now start correctly. A restart cannot create a missing web process, correct a wrong port map, change a loopback bind, repair stale nginx configuration, or alter a blocking firewall rule.
Which log should I read first?
Start with dokku nginx:error-logs APP -t while reproducing one failed request. Use dokku logs APP --tail for application startup and crash details, dokku nginx:access-logs APP to confirm the request reached nginx, and dokku nginx:show-config APP to inspect the generated upstream.
Best Value
How do I correct a wrong internal port?
Run dokku ports:report APP, identify the port the server actually listens on, and set the mapping with dokku ports:set APP http:80:INTERNAL_PORT. Replace the placeholder with the real port; the documented 5000 example is illustrative, not a universal default.
Does Dockerfile EXPOSE guarantee that nginx can connect?
No. EXPOSE can influence Dokku proxy configuration, but the application must still be running, listening on that same port, and bound to 0.0.0.0. An exposed but unused port still results in a 502.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Why does binding to 127.0.0.1 cause a 502?
Loopback accepts traffic only from within the container’s own network namespace. nginx reaches the app through Docker networking, so configure the server to bind to 0.0.0.0:<port> on the mapped internal port.
When should I reload nginx?
Inspect or rebuild the generated configuration first, then run sudo nginx -t or dokku nginx:validate-config APP. Reload with dokku nginx:reload only after validation succeeds.
Can UFW cause a Dokku 502 even when deployment succeeds?
Yes. Dokku’s Ubuntu troubleshooting guidance identifies UFW or another host firewall as a possible cause. Check that HTTP and HTTPS can reach nginx and that host policy does not block the Docker/Dokku path, then reproduce the request while watching the nginx error log.
What should I do if the fix disappears after redeployment?
Recheck process formation, dokku ports:report APP, and dokku nginx:show-config APP. Deployment can regenerate proxy settings, so a durable fix must be represented in the process definition, image/listener configuration, Dokku port settings, or persistent host firewall policy.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
Why does Dokku return 502 immediately after an apparently successful deploy?
A build can succeed while the app has no running web process, exits during startup, listens on the wrong port, or binds only to loopback. Check the process report, app logs, and nginx error log.
Is restarting the app enough to clear a Dokku 502?
Only if the process was temporarily stopped and can now start correctly. Restarting cannot fix a missing web process, wrong port map, loopback bind, stale nginx configuration, or firewall block.
How do I correct a wrong internal port?
Run dokku ports:report APP, identify the application’s actual listening port, then run dokku ports:set APP http:80:INTERNAL_PORT with that value.
Does Dockerfile EXPOSE guarantee that nginx can connect?
No. The application must also be running, listening on that port, and bound to 0.0.0.0.
Recommended Free Tools
Can UFW cause a Dokku 502 on Ubuntu?
Yes. Check that HTTP/HTTPS can reach nginx and that host firewall policy does not block Docker/Dokku traffic.
The Bottom Line
A Dokku 502 is an evidence-driven troubleshooting problem. Confirm a continuously running web process, read the nginx error log during a failed request, align Dokku’s internal port with the application’s listener on 0.0.0.0, validate and reload generated nginx configuration, and then check UFW or other host firewall rules. Test one layer at a time and recheck after redeployments so the correction remains effective.
Quick 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.




