Fix a PAC file that will not work

We'll confirm the PAC URL loads, check the JavaScript and FindProxyForURL logic, rule out caching—or tell you when to contact IT.

Category
Troubleshooting · Home maintenance
Time
10–25 min
Last reviewed
What you'll need
  • PAC file URL (from IT or your network admin)
  • Browser or app that uses the PAC

Step-by-step diagnostic

Step 1 of 6
Show full guide

Steps

Goal: Confirm the PAC URL loads, check the JavaScript and FindProxyForURL logic, and rule out caching.

  • Open the PAC URL in a browser (e.g. http://proxy.company.com/proxy.pac). You should see JavaScript, not a 404 or error page.
  • Good: The PAC loads—proceed to Check PAC content.
  • Bad: 404 or error—the PAC URL is wrong or the server is down. Contact IT. See When to get help.

Check PAC URL and content

Goal: Verify the PAC file has valid JavaScript and FindProxyForURL.

  • The PAC must define function FindProxyForURL(url, host) { ... } and return a string: "DIRECT", "PROXY host:port", or "SOCKS host:port".
  • Check for JavaScript syntax errors (missing brackets, semicolons). Use a linter or paste into a JavaScript console.
  • Good: FindProxyForURL exists and returns correctly—proceed to Test with DIRECT.
  • Bad: Function missing or syntax errors—fix the JavaScript or contact IT.

Test with DIRECT

Goal: Isolate whether the PAC logic is wrong.

  • Create a minimal PAC: function FindProxyForURL(u,h){return "DIRECT";} and host it or point to it. Set the browser to use this PAC.
  • If everything works with DIRECT, the original PAC logic (routing rules) is likely wrong.
  • Good: DIRECT works—the original PAC logic needs fixing. Compare with a working PAC or contact IT.
  • Bad: Even DIRECT fails—the issue may be PAC URL, caching, or browser. Clear cache, try manual proxy. See When to get help.

When to get help

  • The PAC URL returns 404 or the server is down.
  • The PAC is corporate-provided and you cannot edit it.
  • You have fixed the JavaScript and cleared cache but it still fails—the proxy in the PAC may be down; contact IT.

Verification

  • The PAC URL loads in a browser and shows JavaScript.
  • FindProxyForURL exists and returns a valid string.
  • Traffic routes as expected: internal sites direct, external sites via proxy (or per your PAC logic).
  • No proxy-related errors in the browser or app.

Escalation ladder

Work from the device outward. Stop when the problem is fixed.

  1. Confirm PAC URL loads Open the PAC URL in a browser; verify JavaScript, not 404.
  2. Check FindProxyForURL Verify the function exists and returns a valid string.
  3. Test with DIRECT Use a minimal PAC that returns DIRECT to isolate logic.
  4. Clear cache Clear browser and OS cache; reload PAC.
  5. Contact IT Corporate PAC—IT must fix the file or server.

What to capture if you need help

Before calling support or posting for help, have these ready. It speeds everything up.

  • PAC file URL
  • Browser and OS
  • Whether the PAC URL loads (200 vs 404)
  • Error messages if any
  • Steps already tried

Does the PAC URL load (not 404)?

Open the PAC URL in a browser. You should see JavaScript.

Open the PAC URL in a browser. Good: you see JavaScript with FindProxyForURL—check the logic. Bad: 404 or error—PAC URL is wrong or server is down; contact IT.

You can change your answer later.

Does FindProxyForURL exist and return a string?

The PAC must define FindProxyForURL and return DIRECT, PROXY host:port, or SOCKS host:port.

Check the PAC file. FindProxyForURL(url, host) must return a string. Good: function exists and returns correctly—clear cache and test. Bad: missing or wrong return—fix the JavaScript.

You can change your answer later.

Did you clear cache and reload?

Browsers cache PAC files. Clear cache or use private window.

Clear browser cache. Restart browser or use private window. Reload. Good: PAC works after cache clear. Bad: still fails—try manual proxy to isolate; contact IT if corporate PAC.

You can change your answer later.

Fix the JavaScript

Correct FindProxyForURL. Ensure it returns a string. Test with a minimal PAC: return "DIRECT"; first. If that works, the original logic was wrong.

Contact IT

Provide the PAC URL, that it returns 404 or has errors, and what you tried. IT can fix the PAC file or server.

Done

The PAC works. Traffic routes correctly.

Reviewed by Blackbox Atlas

Rate this guide

Was this helpful?

Thanks for your feedback.

Continue to