|
1 | 1 | # Serves Sourcegraph over HTTPS, using Caddy's automatic HTTPS certificate feature: |
2 | 2 | # https://caddyserver.com/docs/automatic-https |
3 | | -# |
4 | | -# Note: This configuration uses Let's Encrypt's staging environment. This will |
5 | | -# allow you to ensure that everything is correctly configured (with a reduced |
| 3 | +# |
| 4 | +# Note: This configuration uses Let's Encrypt's staging environment. This will |
| 5 | +# allow you to ensure that everything is correctly configured (with a reduced |
6 | 6 | # chance of running into rate limit issues). Note that using this configuration |
7 | 7 | # issues a fake certificate (for testing purposes) instead of a trusted one. |
8 | 8 | # |
9 | | -# 🚨 Warning: If your DNS and Caddy configuration aren't properly configured (as |
10 | | -# specified in https://caddyserver.com/docs/automatic-https), you can |
11 | | -# run into Let's Encrypt rate limits which can block your certificates |
12 | | -# for up to a week. |
| 9 | +# 🚨 Warning: If your DNS and Caddy configuration aren't properly configured (as |
| 10 | +# specified in https://caddyserver.com/docs/automatic-https), you can |
| 11 | +# run into Let's Encrypt rate limits which can block your certificates |
| 12 | +# for up to a week. |
13 | 13 | # It's strongly recommened that you use this Caddyfile to test your |
14 | | -# configuration before switching to the production one. |
| 14 | +# configuration before switching to the production one. |
15 | 15 | # |
16 | 16 | # Caddyfile documentation: https://caddyserver.com/docs/caddyfile |
17 | 17 | # |
18 | | - |
19 | 18 | { |
20 | | - # Use Let's Encrypt's staging environment |
21 | | - acme_ca "https://acme-staging-v02.api.letsencrypt.org/directory" |
22 | | - email {$SRC_ACME_EMAIL} |
| 19 | + # Use Let's Encrypt's staging environment |
| 20 | + acme_ca "https://acme-staging-v02.api.letsencrypt.org/directory" |
| 21 | + email {$SRC_ACME_EMAIL} |
23 | 22 | } |
24 | 23 |
|
25 | 24 | {$SRC_SITE_ADDRESS} |
26 | 25 |
|
27 | | -reverse_proxy {$SRC_FRONTEND_ADDRESSES} |
| 26 | +# Add the reverse proxies IPs (or IP CIDR ranges) to the trusted_proxies list. |
| 27 | +# More information in https://caddyserver.com/docs/caddyfile/directives/reverse_proxy |
| 28 | +reverse_proxy { |
| 29 | + to {$SRC_FRONTEND_ADDRESSES} |
| 30 | + trusted_proxies 0.0.0.0/0 |
| 31 | +} |
0 commit comments