Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

A cheap, old Android phone can host a small learning lab with three distinct roles: an origin web server, a reverse proxy that acts as a load balancer, and a cache in front of the origin. The point of the build is to watch how a request moves through those layers and what changes when you alter one of them. It is a teaching setup, not a production server. The one published example we could check ran postmarketOS on a 2015 phone to serve a static page. It does not show that any stock Android phone with 1 GB of RAM can run the same stack, and it says nothing about how much traffic the phone can handle.

What the lab teaches

Keep the origin workload deliberately trivial. If the page is a single static file, the lesson stays on the system around it: how requests are routed, how upstream servers are chosen, and when a response can be reused instead of regenerated. A phone is a good place to learn this because the hardware is small enough that you can see every moving part on one screen.

1. The origin

The origin is the program that actually produces the response. For this lab, a small static site or a tiny application that returns a fixed body is enough. Run it on a port the phone’s web server does not use, such as 8001, so the proxy has something separate to forward to.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. The reverse proxy

A reverse proxy is the front door. Clients talk only to the proxy, and the proxy forwards each request to an upstream server and passes the answer back. NGINX’s documentation describes this role, and its reverse-proxy guide puts it plainly: “A common use of a reverse proxy is to provide load balancing.” (NGINX documentation, “NGINX Reverse Proxy.”) Once the proxy is in place, inspect what reaches the origin. The client’s address is replaced by the proxy’s, which is why the X-Forwarded-For header exists.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

3. The load balancer

A load balancer distributes requests across two or more upstream instances. NGINX’s HTTP load-balancing documentation describes Layer 7 balancing with an upstream group, Round Robin as the default open-source method, and alternatives such as Least Connections and hashing. When you compare them in the lab, use three questions: what rule picks the server, whether the same client keeps landing on the same server, and what state the balancer has to remember to make that choice.

upstream app_pool {
    server 127.0.0.1:8001;
    server 127.0.0.1:8002;
}

server {
    listen 80;

    location / {
        proxy_pass http://app_pool;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

This configuration uses the default Round Robin method. To compare Least Connections, add least_conn; inside the upstream block. To compare hashing, use ip_hash; instead. Running both instances on one phone teaches routing logic, but it does not isolate failures the way two separate machines would. If the phone is off, both instances are off.

4. The cache

A cache sits between clients and the origin. The first request for a page is a miss: the cache fetches from the backend and stores the response. A later request for the same page can be a hit, served from the cache without touching the origin. Varnish’s documentation says it respects the origin’s Cache-Control headers by default, and it includes built-in mechanisms intended to keep private information out of the cache.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Cache policy is where mistakes become privacy problems. A response that is personalized for one user, such as a logged-in dashboard, should not be stored and served to someone else. Use the origin to mark those responses with Cache-Control: private or Cache-Control: no-store, and check the headers before you trust the cache with a page.

Choose the phone and the environment first

Two environments come up in this project, and they behave differently.

Environment What it is What the evidence establishes Main caveat
Termux A terminal app that gives you a Linux-style command line on Android Its documentation says programs run natively on Android, against the Android host kernel and system libraries This is not a desktop Linux install. Package availability and behavior can differ from a conventional Linux system
postmarketOS on the phone A Linux distribution installed on the handset itself A ByteLevelTech tutorial used an old 2015 phone running postmarketOS to serve a web page Compatibility is shown for that one phone only. Support for a different model is not stated by the tutorial

Before you follow any install guide, record four facts about your handset: the Android release, the CPU architecture, the free storage, and whether the packages you need exist for that architecture. In Termux you can check the architecture and model with:

Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
uname -m
getprop ro.product.model
getprop ro.build.version.release

The first command reports the machine architecture, such as aarch64 for 64-bit ARM. The other two report the model and the Android release. A 1 GB RAM device has very little room for a proxy, two application instances, a cache, and a shell at once, so treat the RAM figure as the first constraint to test rather than a guarantee that the stack fits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A build sequence that teaches one idea at a time

Add one layer per step. Each step gives you a result you can check before moving on. These are suggested demonstrations. This article does not report measured results from them.

  1. Serve the origin directly. Open the page from another device on the same network using the phone’s address and the origin’s port. Confirm that the response is correct before adding anything in front of it.
  2. Add the reverse proxy. Point it at the origin with a single proxy_pass and check that requests succeed. Log the forwarded headers in the origin to see what changed.
  3. Add a second upstream instance on a different port. Send ten requests and record which instance answered each one. With Round Robin you should see alternation.
  4. Switch the method to Least Connections or hashing. Repeat the test and compare the pattern. A hashing rule should send the same client to the same upstream every time.
  5. Put the cache in front of the proxy or the origin. Send the same request twice and compare the first response with the second. Confirm the hit or miss status using the cache’s own status header, and confirm that the origin logged only the miss.
  6. Stop one upstream and send requests again. Note what the proxy returns and how long the requests take to fail. Then restart the upstream and observe whether traffic returns to it.
  7. Change the origin’s response and watch the cache keep serving the old copy until it expires or is purged. Discuss why invalidation is harder than storage.

Expect Android to interfere with long-running services

Android manages application process states to save resources. Its Open Source Project documentation describes apps without a user-visible component being moved into a cached state, where they are not expected to keep working actively. For this lab, that means a server you start in a shell may not stay reachable when the screen is off or the system needs memory.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone

Whether the stack stays up continuously depends on the handset, the Android version, the environment, and your battery settings. Do not assume round-the-clock availability from an old phone. Keep the phone plugged in, test over several hours, and record when the service stops. Those stop times are part of the lesson about failure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Setup problems you are likely to hit

The postmarketOS tutorial lists two practical setup problems. Its default NGINX site returns 404 until you configure it, and its firewall blocks incoming web requests until you open the port. Those were recorded in that environment and are not universal rules for every Android or Linux phone. Still, they are a useful checklist:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Symptom Common cause to check What to verify
The phone’s address shows the default NGINX page with a 404 The default site is still active and your configuration is not loaded Confirm the config file is included and reload NGINX after editing
Other devices cannot connect at all The firewall is blocking incoming web requests Open the port you chose and confirm the phone is on the same network
One upstream receives all traffic Hashing sends repeated requests from one client to the same server Test from a second client or switch back to Round Robin
The cache never returns a hit The origin sends headers that tell the cache not to store the response Inspect the Cache-Control header on the origin’s response
The service stops when the screen turns off Android has moved the process into a cached state Check battery restrictions and repeat the test with the phone plugged in

What this lab cannot tell you

The lab shows how the pieces connect. It does not measure how well they perform. No throughput, latency, capacity, or energy figure is established for a 1 GB phone running this stack, so any number you record is a property of your own setup, not a general benchmark. Failure testing on one device also cannot reproduce the separation that real redundancy provides. Use the build to understand the mechanics, then take those mechanics to a deployment environment for real load.

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US

The most valuable outcome is a clear picture of which layer made each decision: the proxy chose the upstream, the balancing method determined the pattern, and the cache policy decided whether the origin was reached at all.

Sources for the material above are the Termux documentation on its execution environment, the NGINX reverse-proxy and HTTP load-balancing documentation, the Varnish Software documentation on cache behavior, the Android Open Source Project documentation on cached application lifecycle, and the ByteLevelTech tutorial describing the postmarketOS phone server.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.