At a glance

This guide is for Shadowrocket users who already have their own configuration or subscription and want to understand what a .conf file does before editing it. It explains common sections, rule order, policy names, and a safe way to test changes. It also covers the additional trust and privacy decisions involved in HTTPS inspection. Section names and supported options can vary with the configuration format and app version, so treat examples as patterns to verify—not as a complete universal specification. Get subscription links and server details from your own provider.

How a .conf file organizes settings

A .conf file is a text configuration, not a server or a subscription by itself. It can contain general settings, routing rules, host mappings, proxy definitions, and other options supported by the format. Shadowrocket reads the sections and entries it recognizes; an imported file may also rely on policy names or proxy definitions elsewhere in the same file. A line that looks reasonable in isolation can therefore fail if it refers to a name that is missing or spelled differently.

Think of the file as a set of related instructions. General settings affect behavior such as DNS or traffic handling. Rules decide which policy applies to a request. Proxy and proxy-group sections define the outbound choices that rules can refer to. Other sections, such as Host or MITM, affect narrower tasks. The precise sections and keys available depend on the configuration source and the features supported by your installed Shadowrocket version.

In Config, select the configuration you intend to use and review its contents before making edits. Keep an untouched copy of the original file. A subscription update may replace or regenerate imported content, so do not assume that a manual change will survive an update. If the configuration is maintained by your provider, ask the provider whether the relevant setting is intended to be edited locally.

[General]
Shared behavior and settings; available keys depend on the configuration format
[Rule]
Ordered matching instructions that select a routing policy
[MITM]
A sensitive area for HTTPS inspection, certificates, and hostname scope

Section headings are commonly written in square brackets on their own lines. Entries beneath a heading belong to that section until the next heading. Blank lines are useful for readability, but they do not create a new section. Keep punctuation, commas, and policy names intact when copying a rule. Avoid pasting formatted text from a rich-text editor, which can introduce typographic quotes or invisible characters that are not part of the expected syntax.

[General]
; general options go here

[Rule]
; ordered rules go here

[Host]
; optional hostname mappings go here

The semicolon comments above are explanatory placeholders, not settings to copy as working values. When troubleshooting, inspect the actual active Config rather than a similarly named file in a folder. Also check Home → Global Routing: a global mode can affect how you interpret a rule test, and a correct rule does not by itself prove that the selected outbound connection is reachable.

Read the main sections without assuming every key is universal

Start with the section name, then identify what each entry refers to. A key in [General] is not a routing rule, and a rule action is not necessarily a server address. The same .conf file may combine locally editable settings with provider-managed proxy definitions. Before changing a value, confirm whether it is a literal setting, a policy name, a domain, an IP range, or a reference to another entry.

Rule entries

DOMAIN-SUFFIX
Matches a domain and its subdomains
DOMAIN
Matches the specified domain
IP-CIDR
Matches an address range in CIDR notation
GEOIP
Matches according to an IP geolocation category
FINAL
Acts as a fallback when earlier rules do not match

A rule’s final field is a policy, such as DIRECT, REJECT, PROXY, or a defined group name.

Other sections

[Proxy]
Holds proxy definitions in the format expected by the file
[Proxy Group]
Defines groups or selection policies when supported
[Host]
Can provide explicit hostname-to-address mappings
[URL Rewrite]
Applies rewrite instructions where supported
[MITM]
Scopes HTTPS inspection by hostname when configured

Do not copy a section’s syntax from an unrelated format without checking compatibility.

For example, PROXY may be a built-in policy name in a rule, while a custom name such as Work Group must correspond to a usable definition in the configuration. If the spelling differs—even by a space—the reference may not point where you expect. A rule that routes to DIRECT does not use a proxy; a rule that routes to REJECT blocks matching traffic. Confirm that the policy you choose is appropriate for your own setup.

Comments and spacing help people read a file, but they do not change the logic. Preserve commas separating rule fields. For domain values, use the form expected by the directive: DOMAIN-SUFFIX,example.com,PROXY is a different kind of match from an IP range rule. Avoid adding a URL scheme or port to a domain-only field unless the format explicitly calls for it.

Some configuration sources include additional sections, custom keys, or generated values. An unfamiliar line is not automatically invalid, and deleting it may remove a feature the source relies on. If you cannot identify a key, search the configuration’s own documentation or ask its maintainer before removing it. Do not publish a full configuration for help: it can contain credentials, private hostnames, or other sensitive information.

Test rule order and matching behavior

Rules are evaluated in order, so an earlier matching rule can determine the route before a later, broader rule is considered. Put a narrow exception above a general domain or address rule when the intended behavior requires it. A final catch-all such as FINAL,PROXY belongs after the specific rules it is meant to fall back from; if an earlier rule already matches, the final rule is not the deciding entry.

The sample below is for explaining structure only. The domain and IP range are documentation examples, not a recommended destination or a real service. Replace policy names only with names that exist in your own active configuration.

[Rule]
DOMAIN,login.example.com,DIRECT
DOMAIN-SUFFIX,example.com,PROXY
IP-CIDR,192.0.2.0/24,DIRECT
GEOIP,CN,DIRECT
FINAL,PROXY

Read the example from top to bottom. The first line matches one exact domain. The second covers the domain suffix and subdomains, but does not override the earlier exact-domain exception. The IP-CIDR entry matches only addresses in the example range. GEOIP uses an IP category and may depend on how the destination is resolved. FINAL provides a fallback for requests that have not matched an earlier rule. Real configurations can use different rule sets and policies.

Rule matching is not the same as successful connectivity. A matching rule can select a policy whose outbound connection is unavailable, misconfigured, or unable to reach the destination. DNS resolution can also affect which information is available for matching. A page may load resources from multiple domains, each of which can match a different rule. When only part of a site fails, identify the failing hostname rather than assuming the main page’s rule covers every request.

Practical check: trace the first applicable rule

For one failing hostname, read the active rules from top to bottom and find the first entry that could match it. Then verify that the policy named in that entry exists and is usable. Change one rule at a time and repeat the same request; changing the rule order, DNS, and outbound selection together makes the result difficult to interpret.

Edit, validate, and compare one change at a time

Use a controlled test rather than replacing a large section based on guesswork. Keep a copy of the original configuration, record the selected connection and Global Routing mode, and choose one reproducible request. In Config, open the active file and make the smallest relevant edit. If the configuration comes from a subscription, note that a subsequent update may overwrite local changes; preserve your own notes separately and confirm the intended maintenance process with the source.

  1. Back up the file

    In Config, identify the active configuration and retain an unchanged copy before editing. Do not share a copy containing credentials, subscription URLs, private hostnames, or server details.

  2. Choose one test

    Write down the exact hostname or app request that fails, the time, the selected connection on Home, and the current Home → Global Routing mode. Use the same request for each comparison.

  3. Check the match

    Find the first rule that can match the request. Confirm the rule type, field order, spelling, and policy name. If the request uses several hostnames, check the failing resource separately.

  4. Make one edit

    Change one rule or setting, save the configuration, and check whether Shadowrocket reports a parsing or configuration issue. Avoid changing DNS, the connection, and several rules in the same test.

  5. Repeat and revert

    Retry the same request under the same network and routing conditions. If the result gets worse or stays unclear, restore the backup before trying a different hypothesis.

If Shadowrocket cannot use the edited configuration, first look for basic syntax problems: a missing comma, an extra character, an inconsistent policy name, or a section heading placed incorrectly. Compare the edited lines with the original and undo the last change. If the file loads but traffic behaves unexpectedly, check the selected Global Routing mode, rule order, destination hostname, and the availability of the referenced policy.

Do not treat an example rule as a diagnostic guarantee. For instance, a domain rule may not explain an IP-based request, and an IP-CIDR rule may be affected by which address was resolved. A connectivity test to a proxy endpoint also does not prove that a specific website’s DNS, TLS handshake, or resources will work. Separate configuration parsing, rule selection, name resolution, and outbound reachability as distinct checks.

HTTPS inspection: certificate trust and privacy implications

HTTPS inspection is a separate and sensitive capability from ordinary routing. When enabled for a hostname, an inspection proxy can act between an app and a destination by presenting a locally trusted certificate and examining traffic covered by the configured scope. This may be used for particular debugging or filtering tasks, but it changes the trust relationship for the selected traffic. It is not required for ordinary proxy connections, and it should not be enabled broadly just to make a site load.

A [MITM] section may specify hostnames for inspection, but the exact supported syntax and certificate workflow depend on the configuration and app version. A hostname entry does not itself prove that the certificate is installed or trusted by the operating system. Follow the certificate instructions shown by Shadowrocket on your platform, and review the system’s certificate-trust controls before proceeding. Menu labels can differ between iPhone, iPad, and computer editions.

[MITM]
hostname = api.example.com

This is a schematic example, not a complete certificate setup. It scopes the example to a single documentation hostname; do not copy it as a working configuration or substitute a broad wildcard without a clear need. A wildcard can include more hostnames than intended. Keep the scope as narrow as the task allows, and remove the entry and related trust configuration when the inspection is no longer needed.

With inspection enabled, the party controlling the inspection certificate and configuration may be able to view or alter traffic within the covered scope, subject to app behavior and other protections. Avoid inspecting banking, health, work, or account-login traffic unless you fully understand the consequences and have explicit authorization. Some apps use certificate pinning or other protections and may refuse connections; do not weaken those protections to force inspection. Never install a certificate from an untrusted source or send a private certificate or its password to someone offering troubleshooting help.

Review the full [MITM] section and the system’s trusted certificate list, not just one hostname line. If you inherited a configuration, ask its maintainer why inspection is included and which domains it covers. When in doubt, disable the inspection feature and test normal routing separately. The client’s one-time purchase or free availability on other platforms does not include a network subscription: obtain any subscription or server details from your own provider.

Why does a rule seem to be ignored?

Check the active Config and Home → Global Routing first. Then inspect the rules from top to bottom for the first match, and verify that its policy name exists. A broader earlier rule can take effect before the entry you expected.

Can I put FINAL before specific rules?

Usually that defeats the purpose of the later rules: a matching final catch-all can route traffic before those specific entries are considered. Place the fallback after the rules intended to take priority, then test with a known hostname.

Will editing a subscription’s .conf file always persist?

No. An update may regenerate or replace provider-managed content. Keep a backup, record your changes, and ask the source whether local edits are supported before relying on them.

Do I need MITM to use HTTPS websites?

No. HTTPS traffic can be routed without enabling HTTPS inspection. Use [MITM] only for a specific, understood purpose, restrict its hostname scope, and review certificate trust and privacy implications before enabling it.