Many developers have encountered the strange phenomenon of their painstakingly built AI assistant working perfectly on their phones when connected to Wi-Fi, but failing to open on their computers – a situation where "it works on phones but not on computers." While the problem seems complex, the underlying reasons are often quite simple. This tutorial will systematically explain this, from common network configurations to easily overlooked server-side settings, helping you pinpoint and resolve the issue step by step.
Why does "phone can access, PC cannot" occur?
Although phones and computers may be connected to the same router, their network environments, system settings, and client behaviors differ significantly. The reason why phones can access but computers cannot is usually attributed to the following:
Different network environments – The phone uses cellular data instead of Wi-Fi, or although connected to the same Wi-Fi network, it is assigned to different subnets.
Firewall or security software blocking – The computer's system firewall or third-party antivirus software is blocking ports or IP addresses.
Inconsistent DNS resolution – The computer and phone are using different DNS servers, resulting in different domain name resolution results.
Browser caching/plugin interference—Old caches, cookies, or ad-blocking plugins in your computer browser are preventing normal access.
Proxy/encrypted channel configuration conflicts—A global proxy or encrypted channel is enabled on your computer, causing traffic to be forwarded incorrectly.
Server bound to local IP only—The AI service only listens on `127.0.0.1`, so it's naturally inaccessible from the phone.
Cross-domain or HTTPS certificate issues—PC browsers are stricter with certificates and CORS policies than mobile browsers.
The following steps will troubleshoot each issue in order.
Step 1: Confirm basic network connectivity
Are your phone and computer on the same local area network (LAN)?
If your phone is using 4G/5G cellular data, while your computer is connected to your home or office Wi-Fi, they are not on the same network. A phone's access doesn't guarantee a computer's. The correct testing method: Connect your phone to the same Wi-Fi network and try again.
Can your computer ping the server IP?
Open a command prompt (CMD or terminal) on your computer and execute:
ping your server's IP address
- If the ping is successful, the network layer is working, and the problem lies at the application layer (port, firewall, service itself).
- If the ping fails, check your computer's Wi-Fi connection, IP address conflicts, and router access control policies.
Step 2: Check your firewall and security software
Windows Defender, the built-in firewall, or third-party antivirus software often block traffic from non-standard ports.
Temporarily disable the firewall for testing (only for troubleshooting; remember to re-enable it after testing):
- Windows: Control Panel → Windows Defender Firewall → Turn the firewall on or off → Temporarily disable
- Linux: `sudo ufw disable` or `sudo systemctl stop firewalld`
If access is possible after disabling the firewall, the problem lies with the firewall rules. You need to allow the corresponding ports (e.g., 8080, 3000, 7860, etc.) in the firewall.
Tip: If the service is running on a cloud server, don't forget to check the security group/firewall rules in your cloud service provider's console—mobile phones can access it because they're using the internal network, while PCs are using the public network, and the security group isn't allowing public ports.
Step 3: Check DNS Resolution
Computers and mobile phones may be using different DNS servers. Mobile phones usually use the carrier's default DNS, while computers may have manually configured different DNS servers, causing the same domain name to resolve to different IPs.
Method 1: Refresh Computer's DNS Cache
Windows
ipconfig /flushdns
Successfully, it will display "DNS resolution cache successfully refreshed."
Method 2: Change Public DNS Servers
In your computer's network settings, change the IPv4 DNS server to:
- Preferred: `8.8.8.8` (Google)
- Alternate: `8.8.4.4`
Or use Cloudflare's `1.1.1.1` and `1.0.0.1`.
Method 3: Check the hosts file for abnormal entries
Open `C:\Windows\System32\drivers\etc\hosts` and check if your domain name is pointed to `127.0.0.1` or another incorrect IP address. If so, delete or comment out that line.
Step 4: Clear browser cache and plugins
Old cache, cookies, or ad-blocking plugins accumulated in your computer's browser often cause page loading errors.
Test with incognito mode:
- Chrome/Edge: Press `Ctrl + Shift + N` to open an incognito window
- Access your AI service in incognito mode
If incognito mode opens, the problem lies with the cache or plugins.
Clear Cache:
- Press `Ctrl + Shift + Delete` → Select "All Time" → Check "Cached Images and Files" → Clear Data
Disable All Extensions:
- Chrome: Top right corner three dots → Extensions → Manage Extensions → Turn off the switches one by one
Step 5: Check Proxy Settings
If you have proxy software such as Encrypting Channel, Clash, running on your computer, traffic may be incorrectly forwarded to other paths, causing inaccessibility to local or intranet services.
Temporarily close all proxy software, then:
- Windows: Settings → Network & Internet → Proxy → Ensure "Use a proxy server" is off
- Or directly turn off the proxy in system settings
Step 6: Check Server Listening Address
This is the most easily overlooked pitfall.
If your AI service (such as Stable Diffusion WebUI, Ollama, LocalAI, etc.) only binds to `127.0.0.1` at startup, then only the local machine (i.e., the server itself) can access it. Access from an external mobile phone will naturally be denied.
Check the service startup command:
- Correct practice: Bind `0.0.0.0` (listening on all network interfaces), for example:
python app.py --host 0.0.0.0 --port 7860
- Incorrect practice: Bind `127.0.0.1` or `localhost`, which only allows access from the local machine.
Modify the startup parameters and restart the service, then try accessing it from a computer.
Step 7: Cross-Origin and HTTPS Certificate Issues
If your AI service has a front-end page, and the front-end and back-end are not under the same domain/port, PC browsers may block requests due to CORS (Cross-Origin Resource Sharing) policies. Mobile browsers have relatively more lenient restrictions on CORS.
Solution: Add a CORS response header to the server to allow cross-origin requests from the PC domain.
Additionally, if the service uses a self-signed HTTPS certificate, PC browsers will display "Insecure" and block access, while mobile browsers may allow it directly. You can temporarily switch to the HTTP protocol for testing, or import the self-signed certificate into your PC's trusted root certificate list.
Step 8: User-Agent Redirect Trap
Some services or reverse proxies (such as Nginx) determine the device type based on the `User-Agent` header, redirecting mobile traffic to the mobile version of the page and PC traffic to another address—if that address is not configured correctly, the PC will be inaccessible.
Simulate a mobile User-Agent in your computer browser:
- Chrome/Firefox: Press F12 to open developer tools → Click the "Device Simulation" icon (phone/tablet icon) → Select a phone model
- Refresh the page. If it opens normally, it indicates a User-Agent redirection logic exists, and you need to check the relevant configurations of Nginx or the server.
Summary: Troubleshooting in this order makes the problem easy to solve.
Troubleshooting Order | Check Items | Quick Verification Method
1. Network Environment: Connect your phone and computer to the same Wi-Fi network and confirm that their IPs are on the same subnet.
2. Firewall/Security Software: Temporarily disable the firewall and test.
3. DNS Resolution: Use `ipconfig /flushdns` + Change the public DNS.
4. Browser Cache/Plugins: Access in incognito mode.
5. Proxy/Encrypted Tunnel: Disable all proxy software.
6. Service Listening Address: Confirm that it is bound to `0.0.0.0` instead of `127.0.0.1`.
7. Cross-Origin/HTTPS Certificate: Check the CORS configuration and temporarily switch to HTTP for testing.
8. User-Agent Redirection: Use developer tools to simulate the phone's UA.
Most "phone can access, PC cannot" problems can be resolved within 10 minutes by following this troubleshooting order.
Leave the professional work to the professionals.
If your AI assistant is deployed on a cloud server but you're constantly plagued by network issues—unsure how to configure firewall rules, open security group ports, or navigate cross-domain configuration—Jtti cloud servers can save you these hassles.
Jtti offers a variety of cloud server solutions, from entry-level (1 core 1GB) to enterprise-grade (8 core 16GB), pre-installed with Linux/Windows dual systems, and supports one-click deployment of AI development environments. Plus, premium CN2 GIA lines ensure low-latency access globally, allowing you to focus on your AI product itself, rather than struggling with network configurations.
Visit the Jtti website now to choose the cloud server solution best suited for your AI project!
EN
CN