이 가이드에서는 강력하고 사용자 친화적인 웹 서버인 Caddy를 사용하여 Outline 서버 설정을 개선하는 방법을 설명합니다. Caddy는 자동 HTTPS 기능과 유연한 구성을 보유하고 있어 특히 WebSocket 전송을 사용할 때 Outline 서버를 제공하는 데 적합합니다.
Caddy란 무엇인가요?
Caddy는 사용 용이성과 자동 HTTPS, 다양한 프로토콜 지원으로 알려진 오픈소스 웹 서버입니다. 웹 서버 구성을 간소화하고 다음과 같은 기능을 제공합니다.
자동 HTTPS: Caddy는 TLS 인증서를 자동으로 획득하고 갱신하므로 보안 연결이 보장됩니다.
HTTP/3 지원: Caddy는 더 빠르고 효율적인 웹 트래픽을 위해 최신 HTTP/3 프로토콜을 지원합니다.
플러그인으로 확장 가능: Caddy는 리버스 프록시, 부하 분산 등 다양한 기능을 지원하기 위해 플러그인으로 확장할 수 있습니다.
xcaddy를 사용하면 Outline 핵심 서버 모듈과 필요한 기타 서버 확장 모듈이 포함된 맞춤 caddy 바이너리를 빌드할 수 있습니다.
xcaddybuild\# The example uses a YAML config, so include a YAML config adapter module.--withgithub.com/iamd3vil/caddy_yaml_adapter\# The Outline core server module.--withgithub.com/Jigsaw-Code/outline-ss-server/outlinecaddy
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-06-18(UTC)"],[],[],null,["# Automatic HTTPS with Caddy\n\nThis guide explains how to use [Caddy](https://caddyserver.com/), a powerful and\nuser-friendly web server, to enhance your Outline server setup. Caddy's\n[automatic HTTPS](https://caddyserver.com/docs/automatic-https) capabilities and\nflexible configuration make it an excellent choice for serving your Outline\nserver, especially when using a WebSocket transport.\n\nWhat is Caddy?\n--------------\n\nCaddy is an open-source web server known for its ease of use, automatic HTTPS,\nand support for various protocols. It simplifies web server configuration and\noffers features like:\n\n- **Automatic HTTPS:** Caddy automatically obtains and renews TLS certificates, ensuring secure connections.\n- **HTTP/3 Support:** Caddy supports the latest HTTP/3 protocol for faster and more efficient web traffic.\n- **Extensible with Plugins:** Caddy can be extended with plugins to support various functionalities, including reverse proxying and load balancing.\n\nStep 1: Prerequisites\n---------------------\n\n- Download and install [`xcaddy`](https://github.com/caddyserver/xcaddy)\n\nStep 2: Configure Your Domain\n-----------------------------\n\nBefore starting Caddy, ensure your domain name is correctly configured to point\nto your server's IP address.\n\n- **Set A/AAAA records:** Sign in to your DNS provider and set the A and AAAA records for your domain to point to your server's IPv4 and IPv6 addresses, respectively.\n- **Verify DNS records:** Verify your DNS records are set correctly with an\n authoritative lookup:\n\n curl \"https://cloudflare-dns.com/dns-query?name=\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e&type=A\" \\\n -H \"accept: application/dns-json\"\n\nStep 3: Build and Run a Custom Caddy Build\n------------------------------------------\n\nUsing `xcaddy`, you can build a custom `caddy` binary that includes the Outline\ncore server module and other needed server extension modules. \n\n xcaddy build \\\n # The example uses a YAML config, so include a YAML config adapter module.\n --with github.com/iamd3vil/caddy_yaml_adapter \\\n # The Outline core server module.\n --with github.com/Jigsaw-Code/outline-ss-server/outlinecaddy\n\nStep 4: Configure and Run the Caddy Server with Outline\n-------------------------------------------------------\n\nCreate a new `config.yaml` file with the following configuration: \n\n apps:\n http:\n servers:\n server1:\n listen:\n - \":443\"\n routes:\n - match:\n - host:\n - '\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e'\n - path:\n - \"/\u003cvar translate=\"no\"\u003eTCP_PATH\u003c/var\u003e\"\n handle:\n - handler: websocket2layer4\n type: stream\n connection_handler: ss1\n - match:\n - host:\n - '\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e'\n - path:\n - \"/\u003cvar translate=\"no\"\u003eUDP_PATH\u003c/var\u003e\"\n handle:\n - handler: websocket2layer4\n type: packet\n connection_handler: ss1\n outline:\n shadowsocks:\n replay_history: 10000\n connection_handlers:\n - name: ss1\n handle:\n handler: shadowsocks\n keys:\n - id: user-1\n cipher: chacha20-ietf-poly1305\n secret: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSHADOWSOCKS_SECRET\u003c/span\u003e\u003c/var\u003e\n\n| **Important:** Keep the `path` secret to avoid probing. It acts as a secret endpoint. A long, randomly generated path is recommended.\n\nThis configuration represents a Shadowsocks-over-WebSockets strategy with a web\nserver listening on port `443`, accepting TCP and UDP Shadowsocks wrapped\ntraffic at paths \u003cvar translate=\"no\"\u003eTCP_PATH\u003c/var\u003e and \u003cvar translate=\"no\"\u003eUDP_PATH\u003c/var\u003e\nrespectively.\n\nRun the Caddy server extended with Outline using the created configuration: \n\n caddy run --config config.yaml --adapter yaml --watch\n\n| **Note:** The example uses YAML because it's more readable and easier to annotate, but you can also use JSON (Caddy's native config language) directly. If you use that, you can run without the `--adapter yaml` flag and remove the YAML adapter dependency in the [build and run step](#build-and-run).\n\nYou can find more example configs in our [outline-ss-server/outlinecaddy GitHub\nrepo](https://github.com/Jigsaw-Code/outline-ss-server/tree/master/outlinecaddy/examples).\n\nStep 5: Create a Dynamic Access Key\n-----------------------------------\n\nGenerate a client access key YAML file for your users using the [advanced\nconfiguration](/outline/docs/guides/service-providers/advanced-config) format and include the WebSocket endpoints\npreviously configured on the server side: \n\n transport:\n $type: tcpudp\n\n tcp:\n $type: shadowsocks\n\n endpoint:\n $type: websocket\n url: wss://\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eTCP_PATH\u003c/var\u003e\n cipher: chacha20-ietf-poly1305\n secret: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSHADOWSOCKS_SECRET\u003c/span\u003e\u003c/var\u003e\n\n udp:\n $type: shadowsocks\n\n endpoint:\n $type: websocket\n url: wss://\u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e/\u003cvar translate=\"no\"\u003eUDP_PATH\u003c/var\u003e\n cipher: chacha20-ietf-poly1305\n secret: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSHADOWSOCKS_SECRET\u003c/span\u003e\u003c/var\u003e\n\nAfter generating the dynamic access key YAML file, you need to get it to your\nusers. You can host the file on a static web hosting service or dynamically\ngenerate it. Learn more about how to use [Dynamic Access\nKeys](/outline/docs/guides/service-providers/dynamic-access-keys).\n\nStep 6: Connect with the Outline Client\n---------------------------------------\n\nUse one of the official [Outline Client](/outline/docs/download-links)\napplications (versions 1.15.0+) and add your newly created dynamic access key as\na server entry. Click **Connect** to start tunneling to your server using the\nShadowsocks-over-Websocket configuration.\n\nUse a tool like [IPInfo](https://ipinfo.io) to verify you are now browsing the\ninternet via your Outline server."]]