Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab6cb1a

Browse files
authored
docs: fix links for revere-proxy docs (#15026)
1 parent 9d02269 commit ab6cb1a

File tree

9 files changed

+129
-128
lines changed

9 files changed

+129
-128
lines changed

docs/admin/setup/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ The Coder server can directly use TLS certificates with `CODER_TLS_ENABLE` and
6161
accompanying configuration flags. However, Coder can also run behind a
6262
reverse-proxy to terminate TLS certificates from LetsEncrypt.
6363

64+
- [Apache](../../tutorials/reverse-proxy-apache.md)
65+
- [Caddy](../../tutorials/reverse-proxy-caddy.md)
66+
- [NGINX](../../tutorials/reverse-proxy-nginx.md)
67+
6468
### Kubernetes TLS configuration
6569

6670
Below are the steps to configure Coder to terminate TLS when running on

docs/admin/setup/web-server/apache/coder.conf

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/admin/setup/web-server/caddy/Caddyfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/admin/setup/web-server/caddy/docker-compose.yaml

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,21 @@
699699
"description": "Learn how to clone Git repositories in Coder",
700700
"path": "./tutorials/cloning-git-repositories.md"
701701
},
702+
{
703+
"title": "Use Apache as a Reverse Proxy",
704+
"description": "Learn how to use Apache as a reverse proxy",
705+
"path": "./tutorials/reverse-proxy-apache.md"
706+
},
707+
{
708+
"title": "Use Caddy as a Reverse Proxy",
709+
"description": "Learn how to use Caddy as a reverse proxy",
710+
"path": "./tutorials/reverse-proxy-caddy.md"
711+
},
712+
{
713+
"title": "Use NGINX as a Reverse Proxy",
714+
"description": "Learn how to use NGINX as a reverse proxy",
715+
"path": "./tutorials/reverse-proxy-nginx.md"
716+
},
702717
{
703718
"title": "FAQs",
704719
"description": "Miscellaneous FAQs from our community",

docs/tutorials/faqs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ troubleshooting.
6262

6363
### How do I configure NGINX as the reverse proxy in front of Coder?
6464

65-
[This doc](../admin/setup/web-server/nginx/index.md) in our repo explains in
66-
detail how to configure NGINX with Coder so that our Tailscale Wireguard
67-
networking functions properly.
65+
[This tutorial](./reverse-proxy-nginx.md) in our docs explains in detail how to
66+
configure NGINX with Coder so that our Tailscale Wireguard networking functions
67+
properly.
6868

6969
### How do I hide some of the default icons in a workspace like VS Code Desktop, Terminal, SSH, Ports?
7070

docs/admin/setup/web-server/apache/index.md renamed to docs/tutorials/reverse-proxy-apache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Requirements
44

55
1. Start a Coder deployment and be sure to set the following
6-
[configuration values](../../index.md):
6+
[configuration values](../admin/setup/index.md):
77

88
```env
99
CODER_HTTP_ADDRESS=127.0.0.1:3000

docs/admin/setup/web-server/caddy/index.md renamed to docs/tutorials/reverse-proxy-caddy.md

Lines changed: 105 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,101 @@ certificates, you'll need a domain name that resolves to your Caddy server.
1111
1. [Install Docker](https://docs.docker.com/engine/install/) and
1212
[Docker Compose](https://docs.docker.com/compose/install/)
1313

14-
1. Start with our example configuration
14+
2. Create a `docker-compose.yaml` file and add the following:
15+
16+
```yaml
17+
services:
18+
coder:
19+
image: ghcr.io/coder/coder:${CODER_VERSION:-latest}
20+
environment:
21+
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
22+
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
23+
# You'll need to set CODER_ACCESS_URL to an IP or domain
24+
# that workspaces can reach. This cannot be localhost
25+
# or 127.0.0.1 for non-Docker templates!
26+
CODER_ACCESS_URL: "${CODER_ACCESS_URL}"
27+
# Optional) Enable wildcard apps/dashboard port forwarding
28+
CODER_WILDCARD_ACCESS_URL: "${CODER_WILDCARD_ACCESS_URL}"
29+
# If the coder user does not have write permissions on
30+
# the docker socket, you can uncomment the following
31+
# lines and set the group ID to one that has write
32+
# permissions on the docker socket.
33+
#group_add:
34+
# - "998" # docker group on host
35+
volumes:
36+
- /var/run/docker.sock:/var/run/docker.sock
37+
depends_on:
38+
database:
39+
condition: service_healthy
40+
41+
database:
42+
image: "postgres:16"
43+
ports:
44+
- "5432:5432"
45+
environment:
46+
POSTGRES_USER: ${POSTGRES_USER:-username} # The PostgreSQL user (useful to connect to the database)
47+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} # The PostgreSQL password (useful to connect to the database)
48+
POSTGRES_DB: ${POSTGRES_DB:-coder} # The PostgreSQL default database (automatically created at first launch)
49+
volumes:
50+
- coder_data:/var/lib/postgresql/data # Use "docker volume rm coder_coder_data" to reset Coder
51+
healthcheck:
52+
test:
53+
[
54+
"CMD-SHELL",
55+
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
56+
]
57+
interval: 5s
58+
timeout: 5s
59+
retries: 5
60+
61+
caddy:
62+
image: caddy:2.6.2
63+
ports:
64+
- "80:80"
65+
- "443:443"
66+
- "443:443/udp"
67+
volumes:
68+
- $PWD/Caddyfile:/etc/caddy/Caddyfile
69+
- caddy_data:/data
70+
- caddy_config:/config
71+
72+
volumes:
73+
coder_data:
74+
caddy_data:
75+
caddy_config:
76+
```
1577
16-
```shell
17-
# Create a project folder
18-
cd $HOME
19-
mkdir coder-with-caddy
20-
cd coder-with-caddy
21-
22-
# Clone coder/coder and copy the Caddy example
23-
git clone https://github.com/coder/coder /tmp/coder
24-
mv /tmp/coder/docs/admin/setup/web-server/caddy $(pwd)
78+
3. Create a `Caddyfile` and add the following:
79+
80+
```caddyfile
81+
{
82+
on_demand_tls {
83+
ask http://example.com
84+
}
85+
}
86+
87+
coder.example.com, *.coder.example.com {
88+
reverse_proxy coder:7080
89+
tls {
90+
on_demand
91+
issuer acme {
92+
93+
}
94+
}
95+
}
2596
```
2697

27-
1. Modify the [Caddyfile](./Caddyfile) and change the following values:
98+
Here;
2899

29-
- `localhost:3000`: Change to `coder:7080` (Coder container on Docker
30-
network)
100+
- `coder:7080` is the address of the Coder container on the Docker network.
101+
- `coder.example.com` is the domain name you're using for Coder.
102+
- `*.coder.example.com` is the domain name for wildcard apps, commonly used
103+
for [dashboard port forwarding](../admin/networking/port-forwarding.md).
104+
This is optional and can be removed.
31105
- `[email protected]`: Email to request certificates from LetsEncrypt/ZeroSSL
32106
(does not have to be Coder admin email)
33-
- `coder.example.com`: Domain name you're using for Coder.
34-
- `*.coder.example.com`: Domain name for wildcard apps, commonly used for
35-
[dashboard port forwarding](../../../networking/port-forwarding.md). This
36-
is optional and can be removed.
37107

38-
1. Start Coder. Set `CODER_ACCESS_URL` and `CODER_WILDCARD_ACCESS_URL` to the
108+
4. Start Coder. Set `CODER_ACCESS_URL` and `CODER_WILDCARD_ACCESS_URL` to the
39109
domain you're using in your Caddyfile.
40110

41111
```shell
@@ -46,11 +116,23 @@ certificates, you'll need a domain name that resolves to your Caddy server.
46116

47117
### Standalone
48118

49-
1. If you haven't already, [install Coder](../../../../install/index.md)
119+
1. If you haven't already, [install Coder](../install/index.md)
50120

51121
2. Install [Caddy Server](https://caddyserver.com/docs/install)
52122

53-
3. Copy our sample [Caddyfile](./Caddyfile) and change the following values:
123+
3. Copy our sample `Caddyfile` and change the following values:
124+
125+
```caddyfile
126+
{
127+
on_demand_tls {
128+
ask http://example.com
129+
}
130+
}
131+
132+
coder.example.com, *.coder.example.com {
133+
reverse_proxy coder:7080
134+
}
135+
```
54136

55137
> If you're installed Caddy as a system package, update the default Caddyfile
56138
> with `vim /etc/caddy/Caddyfile`
@@ -59,14 +141,14 @@ certificates, you'll need a domain name that resolves to your Caddy server.
59141
(does not have to be Coder admin email)
60142
- `coder.example.com`: Domain name you're using for Coder.
61143
- `*.coder.example.com`: Domain name for wildcard apps, commonly used for
62-
[dashboard port forwarding](../../../networking/port-forwarding.md). This
144+
[dashboard port forwarding](../admin/networking/port-forwarding.md). This
63145
is optional and can be removed.
64146
- `localhost:3000`: Address Coder is running on. Modify this if you changed
65147
`CODER_HTTP_ADDRESS` in the Coder configuration.
66148
- _DO NOT CHANGE the `ask http://example.com` line! Doing so will result in
67149
your certs potentially not being generated._
68150

69-
4. [Configure Coder](../../index.md) and change the following values:
151+
4. [Configure Coder](../admin/setup/index.md) and change the following values:
70152

71153
- `CODER_ACCESS_URL`: root domain (e.g. `https://coder.example.com`)
72154
- `CODER_WILDCARD_ACCESS_URL`: wildcard domain (e.g. `*.example.com`).
@@ -116,7 +198,7 @@ By default, this configuration uses Caddy's
116198
[on-demand TLS](https://caddyserver.com/docs/caddyfile/options#on-demand-tls) to
117199
generate a certificate for each subdomain (e.g. `app1.coder.example.com`,
118200
`app2.coder.example.com`). When users visit new subdomains, such as accessing
119-
[ports on a workspace](../../../networking/port-forwarding.md), the request will
201+
[ports on a workspace](../admin/networking/port-forwarding.md), the request will
120202
take an additional 5-30 seconds since a new certificate is being generated.
121203

122204
For production deployments, we recommend configuring Caddy to generate a

docs/admin/setup/web-server/nginx/index.md renamed to docs/tutorials/reverse-proxy-nginx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Requirements
44

55
1. Start a Coder deployment and be sure to set the following
6-
[configuration values](../../index.md):
6+
[configuration values](../admin/setup/index.md):
77

88
```env
99
CODER_HTTP_ADDRESS=127.0.0.1:3000

0 commit comments

Comments
 (0)