Configure a PAC file on your device
After you create a proxy endpoint and create a PAC file, configure your devices to use the PAC file URL. You can configure system-level proxy settings (which apply to most browsers) or configure individual browsers separately.
Chromium-based browsers (Google Chrome, Microsoft Edge, Brave) and Safari use the operating system proxy settings. Firefox uses its own proxy settings by default and must be configured separately.
Before you configure a PAC file on your device, make sure you have:
- A Cloudflare Gateway proxy endpoint
- A PAC file URL (either hosted by Cloudflare or self-hosted)
- The Cloudflare certificate installed on your device (required for HTTPS inspection)
Configure your operating system to use the PAC file. This applies the proxy to all browsers that use system proxy settings (Chrome, Edge, Brave, Safari).
For more information, refer to Use a proxy server in Windows ↗.
- Open the Settings app and select Network & internet > Proxy.
- Next to Use setup script, select Set up.
- In the Edit setup script dialog, turn on Use setup script.
- In the Script address field, enter your PAC file URL.
- Select Save.
For more information, refer to Change proxy settings on Mac ↗.
- Open the Apple menu and select System Settings.
- Select Network in the sidebar.
- Select your active network service (for example, Wi-Fi), then select Details.
- Select Proxies.
- Turn on Automatic proxy configuration.
- In the URL field, enter your PAC file URL.
The setting saves automatically. Chromium-based browsers and Safari will now route traffic through your proxy endpoint.
Steps vary depending on your desktop environment.
GNOME (Ubuntu, Fedora)
- Open Settings > Network.
- Select the gear icon next to your active connection.
- Select the Proxy tab.
- Set the method to Automatic.
- In the Configuration URL field, enter your PAC file URL.
KDE Plasma
- Open System Settings > Network Settings > Proxy.
- Select Use proxy auto configuration URL.
- In the URL field, enter your PAC file URL.
- Select Apply.
iOS does not have a global proxy setting. You must configure the proxy for each Wi-Fi network. Cellular connections do not support PAC files without MDM.
- Open Settings > Wi-Fi.
- Tap the info button next to your connected network.
- Scroll to HTTP Proxy and tap Configure Proxy.
- Select Automatic.
- In the URL field, enter your PAC file URL.
Android does not have a global proxy setting. You must configure the proxy for each Wi-Fi network. Steps vary by device manufacturer and Android version.
On stock Android (Pixel) and most Android devices:
- Open Settings > Network & internet > Internet (or Wi-Fi).
- Tap the gear icon next to your connected network.
- Select Advanced options (or tap the edit icon).
- Under Proxy, select Proxy Auto-Config.
- In the PAC URL field, enter your PAC file URL.
- Tap Save.
For more information, refer to Manage advanced network settings on your Android phone ↗.
ChromeOS uses system-level proxy settings that apply to the Chrome browser.
- Select the time in the status area, then select Settings.
- Select Network, then select Wi-Fi (or Ethernet).
- Select your active connection.
- Expand the Proxy section.
- Select Automatic proxy configuration.
- Enter your PAC file URL.
- Close the settings window. The configuration saves automatically.
For managed ChromeOS devices, refer to Deploy PAC files at scale for Google Admin console instructions.
Firefox uses its own proxy settings and does not inherit the operating system proxy configuration by default. To configure Firefox to use your PAC file:
- In Firefox, go to Settings and scroll to Network Settings.
- Select Settings.
- Select Automatic proxy configuration URL.
- Enter your PAC file URL (for example,
https://pac.cloudflare-gateway.com/<account-id>/<slug>). - Select OK.
HTTP traffic from Firefox is now filtered by Gateway.
For enterprise environments, you can deploy PAC file configurations to managed devices using Group Policy, MDM, or browser management tools.
You can deploy the PAC file URL through Group Policy by configuring the Internet Settings preference:
- Open Group Policy Management and create or edit a Group Policy Object.
- Go to User Configuration > Preferences > Windows Settings > Registry.
- Add a registry item with the following values:
- Hive:
HKEY_CURRENT_USER - Key path:
Software\Microsoft\Windows\CurrentVersion\Internet Settings - Value name:
AutoConfigURL - Value type:
REG_SZ - Value data: Your PAC file URL
- Hive:
Use the Settings Catalog to deploy proxy auto-configuration:
- In the Microsoft Intune admin center ↗, create a new Configuration profile.
- Select Settings catalog as the profile type.
- Search for Proxy and configure the auto-config URL setting for your target platform (Windows or macOS).
- Assign the profile to your device groups.
Deploy a configuration profile with the proxy payload:
- Create a new configuration profile in your MDM solution.
- Add a Global HTTP Proxy or Network payload.
- Set the proxy type to Auto and enter your PAC file URL.
For detailed payload settings, refer to the Network Proxy Configuration settings ↗ in the Apple Platform Deployment guide.
For managed ChromeOS devices and Chrome browsers:
- In the Google Admin console ↗, go to Devices > Networks.
- Select the organizational unit for your managed devices.
- Add or edit a network configuration (Wi-Fi or Ethernet).
- Under Proxy settings, select Automatic proxy configuration.
- Enter your PAC file URL.
- Select Save.
For more information, refer to Set up networks for managed devices ↗.
To deploy proxy settings to managed Chrome browsers on any operating system:
- In the Google Admin console ↗, go to Devices > Chrome > Settings.
- Select the organizational unit for your managed browsers.
- Search for Proxy and configure the Proxy mode to Use a .pac proxy auto-config file.
- Enter your PAC file URL.
- Select Save.
After you configure a PAC file on your device, verify that traffic routes through Gateway:
- Open a browser on the configured device.
- Create an HTTP policy to block a test domain (for example,
example.com). - Visit the blocked domain in your browser.
- Verify that the Gateway block page appears.
If the block page does not appear, refer to the PAC file troubleshooting section for debugging steps.
- Create HTTP policies to filter proxy endpoint traffic.
- Review PAC file best practices for formatting, performance optimization, and bypass rules.
- Use the Proxy Endpoint selector in HTTP and network policies to apply rules to proxy traffic.