Files
coder/docs/tutorials/reverse-proxy-apache.md
T
coder[bot]andNick Vigilante 635a1a8a5f feat(docs): enable Coder.ImperativeNegation Vale rule (#31184)
> [!NOTE]
> Recreated from #30784 under coder[bot] by Superblink, at the request
of @nickvigilante, so he can review and merge it. An AI agent wrote the
original, which was opened from his account. The diff is identical to
#30784, squashed onto current `main`. Superblink reviewed it and ran
Vale over `docs/` before opening this PR (no new warnings or errors).
#30784 should be closed in favor of this one.
> Stack: based on #31183 (#31180 → #31181 → #31182 → #31183 → #31184 →
#31185). The diff matches #30784 except for the counters in
`docs/.style/style-guide/README.md`, which build on the PRs below this
one. `make lint/style-claims` passes at every level.

Depends on #30782.

Adds `Coder.ImperativeNegation`, a Vale rule that flags `don't` where it
opens an imperative and suggests `do not`.
It enforces [Spell out negative
instructions](https://github.com/coder/coder/blob/main/docs/.style/style-guide/voice-and-tone.md#spell-out-negative-instructions).

- Severity: `warning`.
- Scope: `docs/**` except `docs/.style/style-guide/**`, which
demonstrates the violations on purpose.
- Baseline: 14 findings in 9 files.
  The cleanup commit fixes all of them, so the rule ships at zero.
I also fixed one imperative the rule can't see (`**Link to their docs**,
don't duplicate` in `content-guidelines.md`).
- Generated reference pages: no findings, so no exclusion.
- Known gap: an imperative after a bare comma goes unreported.
Declaratives such as `Headings are sentence case, don't lead` share that
shape.

Linear: DOCS-1262

<details><summary>Decision log</summary>

- Boundary pattern, not a verb list. The rule matches `don't` (straight
or curly apostrophe) only after a paragraph start (`\A`), a sentence
end, a colon, a semicolon, or `, and`.
- Comma case. A bare `, don't` produced false positives (`Headings are
sentence case, don't lead`, `events..., such as updates, don't reach
clients`).
The rule instead requires a comma that closes an opening
`If`/`When`/`Before`/`After`/`Unless`/`Once`/`While`/`Until` clause with
no other comma in it.
- `\A` instead of `^`. `^` also matches at a hard-wrapped line start,
which flagged `usually\ndon't.` in `managing-templates/index.md`.
- Bold lead-ins (`**Note:** Don't`) work because Vale strips markup
before matching. Code spans are skipped.
- Table cells and blockquotes are in scope. One table cell and three
blockquote or list lines needed cleanup.
- `Don't know where to start?` is an elliptical question, so it became
`Not sure where to start?`.
- Only `don't` is in scope. `can't` and `won't` are rarely imperative.
- Link uses the GitHub blob form that the existing rules use.
- Enable commit also updates the checks table, the coverage counts
(Voice and tone 0/4 to 1/3, total 9 to 10 tool-checked and 33 to 32
planned), and the "What the tooling checks" counts.

Tests (fixtures in `/tmp`, not committed), each run with LF and CRLF
files:

- Flagged: paragraph-initial `Don't`, `Run it. Don't`, `, and don't`,
curly `If..., don’t`, `; don't`, `**Note:** Don't`, `: don't`, list
item, table cell, blockquote.
- Not flagged: `You don't need`, `Tools that don't`, `Coder won't push`,
`Headings are sentence case, don't lead`, `If X is blocked, Coder
doesn't..., so events, such as updates, don't reach`, a hard-wrapped
line starting with `don't`, and `` `don't` `` in a code span.
- `vale --output=line docs/`: 0 `Coder.ImperativeNegation` findings
outside the style guide.
- `go run ./scripts/styleclaims`, `make lint/emdash`, and the pre-commit
hook (markdown, typos, style-claims) pass.

</details>

*Generated by [Coder Agents](https://coder.com/docs/ai-coder/agents) on
behalf of @nickvigilante.*

Created on behalf of @nickvigilante

Co-authored-by: Nick Vigilante <nick.vigilante@coder.com>
2026-10-23 16:36:44 +00:00

4.4 KiB

title
title
How to use Apache as a reverse proxy with Let's Encrypt

Requirements

  1. Start a Coder deployment and be sure to set the following configuration values:

    CODER_HTTP_ADDRESS=127.0.0.1:3000
    CODER_ACCESS_URL=https://coder.example.com
    CODER_WILDCARD_ACCESS_URL=*coder.example.com
    

    Throughout the guide, be sure to replace coder.example.com with the domain you intend to use with Coder.

  2. Configure your DNS provider to point your coder.example.com and *.coder.example.com to your server's public IP address.

    For example, to use coder.example.com as your subdomain, configure coder.example.com and *.coder.example.com to point to your server's public ip. This can be done by adding A records in your DNS provider's dashboard.

  3. Install Apache (assuming you're on Debian/Ubuntu):

    sudo apt install apache2
    
  4. Enable the following Apache modules:

    sudo a2enmod proxy
    sudo a2enmod proxy_http
    sudo a2enmod ssl
    sudo a2enmod rewrite
    
  5. Stop Apache service and disable default site:

    sudo a2dissite 000-default.conf
    sudo systemctl stop apache2
    

Install and configure LetsEncrypt Certbot

  1. Install LetsEncrypt Certbot: Refer to the CertBot documentation. Be sure to pick the wildcard tab and select your DNS provider for instructions to install the necessary DNS plugin.

Create DNS provider credentials

This example assumes you're using CloudFlare as your DNS provider. For other providers, refer to the CertBot documentation.

  1. Create an API token for the DNS provider you're using: e.g. CloudFlare with the following permissions:

    • Zone - DNS - Edit
  2. Create a file in .secrets/certbot/cloudflare.ini with the following content:

    dns_cloudflare_api_token = YOUR_API_TOKEN
    
    mkdir -p ~/.secrets/certbot
    touch ~/.secrets/certbot/cloudflare.ini
    nano ~/.secrets/certbot/cloudflare.ini
    
  3. Set the correct permissions:

    sudo chmod 600 ~/.secrets/certbot/cloudflare.ini
    

Create the certificate

  1. Create the wildcard certificate:

    sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini -d coder.example.com -d *.coder.example.com
    

Configure Apache

This example assumes Coder is running locally on 127.0.0.1:3000 and that you're using coder.example.com as your subdomain.

  1. Create Apache configuration for Coder:

    sudo nano /etc/apache2/sites-available/coder.conf
    
  2. Add the following content:

     # Redirect HTTP to HTTPS
     <VirtualHost *:80>
         ServerName coder.example.com
         ServerAlias *.coder.example.com
         Redirect permanent / https://coder.example.com/
     </VirtualHost>
    
     <VirtualHost *:443>
         ServerName coder.example.com
         ServerAlias *.coder.example.com
         ErrorLog ${APACHE_LOG_DIR}/error.log
         CustomLog ${APACHE_LOG_DIR}/access.log combined
    
         ProxyPass / http://127.0.0.1:3000/ upgrade=any # required for websockets
         ProxyPassReverse / http://127.0.0.1:3000/
         ProxyRequests Off
         ProxyPreserveHost On
    
         RewriteEngine On
         # Websockets are required for workspace connectivity
         RewriteCond %{HTTP:Connection} Upgrade [NC]
         RewriteCond %{HTTP:Upgrade} websocket [NC]
         RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]
    
         SSLCertificateFile /etc/letsencrypt/live/coder.example.com/fullchain.pem
         SSLCertificateKeyFile /etc/letsencrypt/live/coder.example.com/privkey.pem
     </VirtualHost>
    

    Do not forget to change: coder.example.com by your (sub)domain

  3. Enable the site:

    sudo a2ensite coder.conf
    
  4. Restart Apache:

    sudo systemctl restart apache2
    

Refresh certificates automatically

  1. Create a new file in /etc/cron.weekly:

    sudo touch /etc/cron.weekly/certbot
    
  2. Make it executable:

    sudo chmod +x /etc/cron.weekly/certbot
    
  3. And add this code:

    #!/bin/sh
    sudo certbot renew -q
    

And that's it, you should now be able to access Coder at your sub(domain) e.g. https://coder.example.com.