iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Run NGINX as the only public web server on ports 80 and 443, move Apache to a loopback port such as 127.0.0.1:8080, and keep the Node.js application on its own private port such as 127.0.0.1:3000. NGINX then reverse-proxies each hostname or path to the correct backend. This removes port conflicts while allowing Apache to continue serving PHP and phpMyAdmin.
The safest layout uses separate hostnames: one for Node.js and another for phpMyAdmin. A single-hostname, path-based setup is possible, but it requires more careful handling of redirects, cookies, trailing slashes and phpMyAdmin’s externally visible URL.
The working architecture
Two services cannot listen on the same IP address and TCP port. If Apache already owns :80, NGINX cannot bind there until Apache is moved. The practical solution is to give each component a distinct role:
Internet client
|
NGINX :80/:443
/
Node.js :3000 Apache :8080
|
PHP + phpMyAdmin
NGINX is the public edge. It accepts HTTP and HTTPS connections, terminates TLS, performs HTTP-to-HTTPS redirects, and chooses an upstream using the requested hostname or URL path. Node.js remains an HTTP service on a private listener. Apache remains the PHP-capable backend, including a traditional phpMyAdmin installation or a phpMyAdmin container exposing an Apache listener.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
NGINX’s proxy flow is straightforward: it sends a request to a specified upstream, receives the response, and sends that response to the client. Apache can also operate as a reverse-proxy gateway, but in this design it is the private PHP server behind NGINX.
Plan ports and bindings before changing anything
Write down the intended listeners and make sure no two processes claim the same address and port.
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 & 11| Component | Recommended listener | Publicly reachable? | Purpose |
|---|---|---|---|
| NGINX | 0.0.0.0:80 and 0.0.0.0:443 (or the server’s public address) |
Yes | Public HTTP, HTTPS, TLS termination and routing |
| Apache | 127.0.0.1:8080 |
No | PHP pages and phpMyAdmin |
| Node.js | 127.0.0.1:3000 |
No | Application HTTP traffic |
You can choose different unused private ports. The important properties are that NGINX alone owns public 80/443 and that the backends are bound to loopback or another deliberately protected private interface.
Find the current owners of ports 80 and 443
Run this before editing configuration:
sudo ss -ltnp | grep -E ':(80|443)b'
The output identifies the process and PID listening on each port. If a distribution uses another diagnostic utility, an equivalent socket-listening command is fine. Do not stop a service blindly; first determine whether it is Apache, NGINX, a container port mapping, or another application.
Check the private ports too
sudo ss -ltnp | grep -E ':(3000|8080)b'
If either port is occupied, select another port and use it consistently in the application, Apache, NGINX and any container mapping.
Move Apache to a private listener
Change both the Apache listen directive and the address in the virtual host. On Debian- or Ubuntu-style installations, the listener is commonly in /etc/apache2/ports.conf, while the site’s virtual host is in /etc/apache2/sites-available/. A minimal arrangement is:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
# /etc/apache2/ports.conf
Listen 127.0.0.1:8080
# /etc/apache2/sites-available/phpmyadmin.conf
<VirtualHost 127.0.0.1:8080>
ServerName db.example.com
DocumentRoot /var/www/html
<Directory /var/www/html>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Use the actual document root and PHP configuration for your server. If Apache has an existing Listen 80 or a <VirtualHost *:80>, remove or replace those entries so Apache no longer attempts to claim public port 80. Keep only the virtual hosts needed on the private listener.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Validate and reload Apache
- Check syntax:
sudo apachectl configtestContinue only when the result is
Syntax OK. - Reload Apache without unnecessarily dropping existing connections:
sudo systemctl reload apache2On systems using a different service name, use that name.
- Confirm the listener:
sudo ss -ltnp | grep ':8080b' - Test the backend directly from the server:
curl -i -H 'Host: db.example.com' http://127.0.0.1:8080/
The direct curl test must produce an Apache response before NGINX is introduced. If it fails, inspect Apache’s error log and fix the backend first.
Keep Node.js on its own private HTTP port
Configure the Node.js server to listen on 127.0.0.1:3000 (or your selected private address and port). Do not bind it publicly unless there is a specific reason to bypass NGINX. A typical environment setting is:
HOST=127.0.0.1
PORT=3000
The exact variable names depend on the application. Confirm that the process actually binds to the intended address:
Free tools Windows power users keep installed
One-click scans. No signup required.
sudo ss -ltnp | grep ':3000b'
curl -i http://127.0.0.1:3000/
Run the Node.js process under a supervisor such as systemd, and send its application logs to a location you can inspect independently from NGINX logs. A restart policy helps recover from a crash, but it does not replace application health checks.
Example systemd service
[Unit]
Description=Node.js application
After=network.target
[Service]
WorkingDirectory=/srv/my-node-app
Environment=NODE_ENV=production
Environment=PORT=3000
Environment=HOST=127.0.0.1
ExecStart=/usr/bin/node /srv/my-node-app/server.js
Restart=on-failure
User=nodeapp
[Install]
WantedBy=multi-user.target
Adjust the path, user and Node.js executable for the host. After creating the unit, run sudo systemctl daemon-reload, enable it, start it, and test port 3000 directly before configuring NGINX.
Configure NGINX as the public reverse proxy
Install NGINX using your operating system’s supported package, then create server blocks for the public names. The proxy headers below preserve the original host, client address and scheme for applications that generate redirects, absolute links or logs.
Separate hostnames: the preferred design
Use one hostname for the Node.js application and another for phpMyAdmin. For example, app.example.com can route to port 3000 and db.example.com can route to Apache on port 8080.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
# /etc/nginx/sites-available/app.example.com
server {
listen 80;
listen [::]:80;
server_name app.example.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
}
}
# /etc/nginx/sites-available/db.example.com
server {
listen 80;
listen [::]:80;
server_name db.example.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080;
}
}
Enable the sites according to your distribution’s convention, remove or disable any default server that would catch these names unexpectedly, and test the configuration:
sudo nginx -t
sudo systemctl reload nginx
Use the same header policy for both upstreams. Host lets Apache and the application select the correct virtual host; X-Real-IP and X-Forwarded-For preserve client-address information; and X-Forwarded-Proto tells the backend whether the original request was HTTP or HTTPS.
Support WebSockets when the Node.js application needs them
WebSockets require an HTTP/1.1 connection and upgrade headers. Define a connection map in NGINX’s http context:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
Then add these directives inside the Node.js location block:
Recommended Free Tools
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Only add upgrade handling where the application uses WebSockets. Test an actual socket connection; an ordinary page response does not prove that upgrades work.
Add HTTPS and keep TLS at NGINX
Terminate TLS at NGINX unless you have a deliberate requirement to encrypt the second hop as well. NGINX can redirect port 80 to HTTPS and serve the certificates on 443, while the local proxy connections remain HTTP over loopback.
server {
listen 80;
listen [::]:80;
server_name app.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name app.example.com;
ssl_certificate /etc/ssl/example/app/fullchain.pem;
ssl_certificate_key /etc/ssl/example/app/privkey.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
}
}
Create an equivalent HTTPS server block for the phpMyAdmin hostname with proxy_pass http://127.0.0.1:8080. Use certificates and paths appropriate to your certificate-management method. After every change, run nginx -t before reloading.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Serve phpMyAdmin through Apache
Apache can serve a normal phpMyAdmin installation using its PHP module and an Alias, or it can front the official phpMyAdmin container. In either case, NGINX should be the only public entry point. The Apache listener and any container-published backend port must not be exposed directly to the Internet.
Direct Apache installation
Ensure PHP is enabled in Apache and that the phpMyAdmin directory is available under the private virtual host. A simple Alias-based pattern is:
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Require all granted
AllowOverride All
</Directory>
Use the package’s actual installation path and the access controls appropriate for your environment. Restricting phpMyAdmin by VPN, firewall source address or an additional authentication layer is preferable to making an administrative database interface broadly available.
Containerized phpMyAdmin
A container can expose its internal Apache port 80 to a host-only port, for example 127.0.0.1:8090:80. NGINX then proxies to that host port, or Apache can listen on 8080 if it is the host-level backend. The image supports an APACHE_PORT setting for changing the Apache listener inside the image and host-to-container port mapping for publishing it.
Keep the mapping loopback-only where possible. Confirm it with:
docker ps
docker port phpmyadmin
If the container is behind a reverse proxy, set PMA_ABSOLUTE_URI to the full URL users actually open, including the trailing slash. For example:
PMA_ABSOLUTE_URI=https://db.example.com/phpmyadmin/
Do not set an internal container URL when users arrive through a different public hostname or path. phpMyAdmin uses its externally visible URL when constructing links and handling authentication redirects.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Choose between hostnames and a single path
| Consideration | Separate hostnames | One hostname with /phpmyadmin/ |
|---|---|---|
| Cookies and redirects | Usually simpler because the application and phpMyAdmin have distinct origins. | More sensitive to cookie paths, trailing slashes and absolute-URL settings. |
| NGINX configuration | One server block per hostname with a simple root location. | Requires carefully ordered locations and deliberate path forwarding. |
| TLS management | Each hostname must be covered by the certificate configuration. | One certificate name can cover both services. |
| phpMyAdmin isolation | Easy to restrict the database hostname independently. | Shares the application hostname and its access policy. |
| Troubleshooting | Backend selection is easy to see from the Host header. | Failures can involve URI rewriting, cookies and redirects at the same time. |
Path-based example
With one hostname, send the root to Node.js and the phpMyAdmin prefix to Apache. Put the more specific location first and decide whether the upstream should receive the prefix unchanged:
server {
listen 443 ssl;
server_name example.com;
# certificate directives omitted here
location ^~ /phpmyadmin/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:8080;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
}
}
Here the URI is passed without an automatic prefix replacement because proxy_pass has no URI suffix. If Apache serves phpMyAdmin at a different internal path, use an explicit rewrite or a trailing-slash form only after confirming exactly which URI Apache expects. Test both /phpmyadmin and /phpmyadmin/; many applications redirect one form to the other.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSet PMA_ABSOLUTE_URI to https://example.com/phpmyadmin/ for a containerized deployment. For a direct installation, set phpMyAdmin’s absolute-URL option when automatic detection cannot determine the public path.
Validate each layer in order
Testing from the inside out makes it clear which service is failing.
- Check listeners.
sudo ss -ltnpOnly NGINX should be visible on public 80/443. Apache should show 127.0.0.1:8080 (or your chosen private address), and Node.js should show 127.0.0.1:3000.
- Test Node.js directly.
curl -i http://127.0.0.1:3000/Confirm the expected status and response before involving NGINX.
- Test Apache directly with the virtual-host name.
curl -i -H 'Host: db.example.com' http://127.0.0.1:8080/ - Test each public hostname through NGINX.
curl -i https://app.example.com/ curl -i https://db.example.com/For a path design, also test
https://example.com/phpmyadmin/. - Verify redirects. Check that HTTP redirects to HTTPS and that the final Location header uses the public hostname, not 127.0.0.1, an internal port or an HTTP scheme.
- Verify forwarded information. Inspect application and Apache logs for the expected Host, client-address headers and HTTPS scheme.
- Exercise phpMyAdmin. Log in, reload the page, browse a table and perform a harmless state-changing operation. A successful first page is not enough to prove that cookies and form URLs are correct.
Troubleshoot common failures
NGINX reports “address already in use”
Another process still owns 80 or 443. Use ss -ltnp to identify it, remove the conflicting NGINX or Apache listener, and test again. Do not solve the problem by assigning both services the same port.
502 Bad Gateway from NGINX
- Confirm that Node.js or Apache is running.
- Confirm the upstream address and port in
proxy_pass. - Use curl against the private backend from the same server.
- Inspect the NGINX error log and the backend’s service log.
- For containers, verify that the host-to-container mapping points to the actual internal Apache port.
Apache works directly but the wrong site appears through NGINX
NGINX may be sending the wrong Host header, or Apache may not have the intended virtual host on the private listener. Test with a curl command that supplies the expected Host value and ensure the NGINX server block’s server_name matches the requested hostname.
phpMyAdmin repeatedly asks for a login
This commonly indicates that the public URL, cookie path or forwarded scheme is inconsistent. Confirm that NGINX sends Host and X-Forwarded-Proto, that HTTPS is not being misdetected as HTTP, and that a container uses the exact public PMA_ABSOLUTE_URI with a trailing slash.
A form submission returns 404
Check whether the proxy changed or stripped /phpmyadmin/, whether the request lost its trailing slash, and whether phpMyAdmin generated an internal URL instead of the public one. Compare the browser’s submitted URL with the Apache access log and adjust the NGINX path handling or phpMyAdmin absolute-URL setting.
WebSocket requests fail while normal pages work
Add proxy_http_version 1.1 and the Upgrade/Connection headers in the Node.js location, then verify the application itself accepts WebSocket connections on port 3000. Ordinary HTTP success does not validate the upgrade path.
Security and operational safeguards
- Expose only NGINX’s 80 and 443 listeners in the firewall. Keep 8080, 8090 and 3000 loopback-only unless a documented network design requires otherwise.
- Protect phpMyAdmin with strong database credentials and, where practical, VPN or source-address restrictions and an additional authentication layer.
- Use separate logs for NGINX, Apache, phpMyAdmin and Node.js. Include request IDs or timestamps when tracing a failed login or redirect.
- Reload one service at a time. Run
apachectl configtestornginx -tbefore each reload and inspect the relevant error log immediately afterward. - Renew TLS certificates before expiry and verify both hostnames after renewal.
- Back up NGINX, Apache and phpMyAdmin configuration before changing listener addresses or proxy paths.
What to remember
The arrangement succeeds when ownership is unambiguous: NGINX owns public 80/443, Apache owns a private PHP port, and Node.js owns a separate private application port. Test both backends directly, then test each public route through NGINX. Preserve the original Host and forwarding headers, and configure phpMyAdmin with the URL users actually see. Separate hostnames normally require less path and cookie troubleshooting; a shared hostname is viable when its prefix rewriting and absolute-URL behavior are tested deliberately.
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 →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.

