· Rules & Routing · About 8 min read

Shadowrocket Proxy Rules for Specific Websites: Route Selected Domains Through a Proxy

Set Global Routing to Config, use DOMAIN-SUFFIX rules to proxy selected domains, and send all other traffic to FINAL,DIRECT. Learn how to verify the routing results.

At a glance

To proxy only selected websites in Shadowrocket, three conditions must be met: Global Routing must be set to Config, the active configuration must include PROXY rules for the target domains, and FINAL,DIRECT must handle all remaining requests. This guide is for users who already have connection details from their provider. Follow the steps to prepare the configuration, add rules, and check match logs. It also explains how to tell an unmatched rule from a failed connection.

1. Select Config and check the active configuration

If correctly written rules have no effect, first check Home → Global Routing. Since this guide routes traffic by domain, select Config. Editing a file in Config while Global Routing is set to Proxy will not test the intended setup: selected websites use a proxy while others connect directly.

The options below cover only the three settings relevant to this task; they are not a complete list of Global Routing options. Config applies the rules in the configuration, while PROXY in a rule sends requests to the proxy policy. The names are similar, but these are separate settings.

Config

Recommended

Requests follow the rules in the active configuration. Target domains can use PROXY, while other requests can connect directly through FINAL,DIRECT.

Best for: Routing only explicitly listed domains through a proxy.

Proxy

Routes intercepted requests through the proxy instead of splitting them according to the domain list in this guide. After using it temporarily, switch back to Config before testing domain-based routing.

Best for: Temporarily checking whether an existing proxy connection can reach a target.

Direct

Routes intercepted requests directly. A PROXY domain rule in the configuration will not automatically override this setting.

Best for: Checking how a target behaves with a direct connection on the current network.

Takeaway: Keep the test conditions consistent

Before making changes, note the configuration file name, selected connection, and Global Routing setting. Change only one rule at a time so you can tell whether a result comes from a configuration switch, a connection change, or the rule itself.

2. Build a minimal rule configuration in four steps

First, confirm that a usable connection is selected in Home, then open Config to work on the configuration. An existing subscription may manage connection details, but that does not mean the domain-routing rules in this guide are enabled. Check connection list updates and configuration rule changes separately.

  1. Back up the configuration

    Open Config, note the selected file, and use an available share or export option to keep a copy of the original. When editing an existing configuration, preserve its DNS, Host, and policy settings. Avoid replacing the entire file just to add domains.

  2. Edit the rules

    In Config, open the configuration you plan to use and enter edit mode. Add the example below to the existing [Rule] section. If the file already has this section, edit it rather than adding a second section with the same name.

  3. Select the file

    After saving, return to Config and make sure the file you just edited is selected, not another configuration with a similar name. Saving a file alone does not mean it has been selected.

  4. Set the routing mode

    Go to Home → Global Routing → Config. Confirm the intended connection is still selected in Home, then enable or reconnect. Check the results with new requests rather than relying only on pages that were already open.

3. List proxy domains with DOMAIN-SUFFIX

The domains below are syntax examples, not connection server addresses. Replace them with the domains of the websites you need to access. Do not include https://, a port, or a path in a rule. For example, if the target page is https://www.example.com/account, the domain to match is www.example.com.

[Rule]
DOMAIN-SUFFIX,example.com,PROXY
DOMAIN-SUFFIX,example.org,PROXY
FINAL,DIRECT

DOMAIN-SUFFIX,example.com,PROXY matches example.com itself and its subdomains, such as www.example.com and api.example.com. It does not match any domain that merely contains the word example, so notexample.com is not considered a subdomain.

2 rules
Example DOMAIN-SUFFIX proxy rules
1 rule
FINAL,DIRECT at the end of the rules
3 fields
Each domain rule lists the type, domain, and policy in that order

To proxy just one hostname without including other hosts under the same domain, use a narrower DOMAIN rule. The example below matches only api.example.com. A request to www.example.com will not match this line and will continue to the next rule.

[Rule]
DOMAIN,api.example.com,PROXY
FINAL,DIRECT

DOMAIN and DOMAIN-SUFFIX cannot distinguish between page paths on the same domain. To proxy /video while connecting directly to /news on the same website, adding a path after DOMAIN-SUFFIX will not work. First decide whether you need to route by domain or by page content, then determine whether this method fits.

4. Check rule order and the position of FINAL

Rules are checked in order, and matching a rule usually stops the search. Put more specific exceptions before broader rules. FINAL is the fallback for remaining requests: do not place it before the domain rules you want to match, and do not stack duplicate FINAL rules from multiple configurations in the same rule section.

[Rule]
DOMAIN,account.example.com,DIRECT
DOMAIN-SUFFIX,example.com,PROXY
FINAL,DIRECT

In this example, account.example.com matches DIRECT first. Other hosts under example.com can still match the later PROXY rule. If you swap the first two lines, the broader DOMAIN-SUFFIX rule matches first and the direct-connection exception will not work as intended.

5. Verify routing in the connection logs

A page loading successfully only shows that the request worked; it does not prove that the intended policy was used. Check the target hostname, matched rule, and actual policy together. To reduce interference from existing connections and cached pages, generate fresh requests to both the target website and a website not on the list.

  1. Confirm Home → Global Routing is still set to Config, the edited file is still selected in Config, and the connection is enabled.
  2. Open the target website again, then find its hostname in the in-app connection logs. Check whether the expected DOMAIN or DOMAIN-SUFFIX rule matched and whether the request was sent to PROXY.
  3. Visit a website that is not on the proxy list and check that its request is handled by FINAL and sent to DIRECT. Do not use another subdomain of the same website as your comparison.
  4. If the page redirects, requires sign-in, or fails to load images, check the hostnames in the new requests separately. Record the main page domain and its resource domains separately; do not rely only on the address bar.
Observed resultCheck firstNext step
Target request matches FINAL,DIRECTDomain scope and active configurationCheck the actual hostname in the log and confirm it falls under one of the configured domain suffixes.
Target matches PROXY, but the request times outSelected connection and server reachabilityLeave the rules unchanged and check the existing connection details and connection test results.
Unlisted websites also use PROXYGlobal Routing and other proxy rulesMake sure Global Routing is not set to Proxy, then check earlier rules and rule set references.
Page text loads, but images or sign-in failResource and authentication domainsFind the hostnames of failed requests and add narrowly scoped rules if needed.

These are expected patterns for interpreting connection logs, not speed test results for every network. If the logs show that PROXY matched correctly, adding the same domain again will not help. Check the connection settings, server status, or access restrictions on the target instead.

6. Check resource domains, DNS, and automatic connection behavior

A webpage may request content from the main site, a sign-in API, image domains, and a separate content delivery domain. Adding a DOMAIN-SUFFIX rule for the main site does not mean all its dependencies share that suffix. Check the failed request logs to identify each domain’s purpose before adding a rule. Avoid proxying an overly broad range of public domains to fix a single resource.

If you temporarily change On Demand while troubleshooting, restore the settings you need afterward. Do not use an always-on connection switch as a substitute for checking the actual policy. Connection status shows whether traffic interception is active; the rule log shows where each request was routed.

7. Keep a rule list you can roll back

After verifying the setup, keep a working copy of the configuration and note why each domain was added. If a feature later fails, check whether it introduced new request domains before making a small, targeted change. Keep the rules aligned with actual needs instead of continually expanding the proxy scope.

Shadowrocket is a closed-source commercial app. Buying the app is separate from purchasing a connection plan. This guide assumes you already have a provider and connection details. The app is primarily for iPhone and iPad; check the App Store listing for compatibility with Mac, Apple TV, and Apple Vision. System requirements and purchase eligibility are as listed on the App Store page. The App Store is the only place to get the app.

Download Shadowrocket