Skip to content

Commit 4d0deb6

Browse files
committed
updated with requested changes
1 parent 5b54368 commit 4d0deb6

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

examples/web-server/nginx/README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
## Requirements
44

5-
1. Start a Coder deployment and be sure to set the following [configuration values](https://coder.com/docs/v2/latest/admin/configure):.
5+
1. Start a Coder deployment and be sure to set the following [configuration values](https://coder.com/docs/v2/latest/admin/configure):
66

7-
2. Configure your DNS provider to point your CODER_SUBDOMAIN and \*.CODER_SUBDOMAIN to your server's public IP address.
7+
```console
8+
CODER_HTTP_ADDRESS=127.0.0.1:3000
9+
CODER_ACCESS_URL=https://coder.example.com
10+
CODER_WILDCARD_ACCESS_URL=*coder.example.com
11+
```
12+
13+
Throughout the guide, be sure to replace `coder.example.com` with the domain you intend to use with Coder.
14+
15+
2. Configure your DNS provider to point your coder.example.com and \*.coder.example.com to your server's public IP address.
816

917
> 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.
1018
@@ -22,18 +30,18 @@
2230

2331
## Adding Coder deployment subdomain
2432

25-
> This example assumes Coder is running locally on `127.0.0.1:3000` for the subdomain `CODER_SUBDOMAIN` e.g. `coder.example.com`.
33+
> This example assumes Coder is running locally on `127.0.0.1:3000` and that you're using `coder.example.com` as your subdomain.
2634
2735
1. Create NGINX configuration for this app:
2836

2937
```console
30-
sudo touch /etc/nginx/sites-available/CODER_SUBDOMAIN
38+
sudo touch /etc/nginx/sites-available/coder.example.com
3139
```
3240

3341
2. Activate this file:
3442

3543
```console
36-
sudo ln -s /etc/nginx/sites-available/CODER_SUBDOMAIN /etc/nginx/sites-enabled/CODER_SUBDOMAIN
44+
sudo ln -s /etc/nginx/sites-available/coder.example.com /etc/nginx/sites-enabled/coder.example.com
3745
```
3846

3947
## Install and configure LetsEncrypt Certbot
@@ -55,7 +63,7 @@
5563
```console
5664
mkdir -p ~/.secrets/certbot
5765
touch ~/.secrets/certbot/cloudflare.ini
58-
vi ~/.secrets/certbot/cloudflare.ini
66+
nano ~/.secrets/certbot/cloudflare.ini
5967
```
6068

6169
3. Set the correct permissions:
@@ -77,14 +85,14 @@
7785
1. Edit the file with:
7886

7987
```console
80-
sudo nano /etc/nginx/sites-available/CODER_SUBDOMAIN
88+
sudo nano /etc/nginx/sites-available/coder.example.com
8189
```
8290

8391
2. Add the following content:
8492

8593
```nginx
8694
server {
87-
server_name CODER_SUBDOMAIN *.CODER_SUBDOMAIN;
95+
server_name coder.example.com *.coder.example.com;
8896
8997
# HTTP configuration
9098
listen 80;
@@ -98,8 +106,8 @@
98106
# HTTPS configuration
99107
listen [::]:443 ssl ipv6only=on;
100108
listen 443 ssl;
101-
ssl_certificate /etc/letsencrypt/live/CODER_SUBDOMAIN/fullchain.pem;
102-
ssl_certificate_key /etc/letsencrypt/live/CODER_SUBDOMAIN/privkey.pem;
109+
ssl_certificate /etc/letsencrypt/live/coder.example.com/fullchain.pem;
110+
ssl_certificate_key /etc/letsencrypt/live/coder.example.com/privkey.pem;
103111
104112
location / {
105113
proxy_pass http://127.0.0.1:3000; # Change this to your coder deployment port default is 3000
@@ -115,8 +123,7 @@
115123
}
116124
```
117125

118-
> Don't forget to change:
119-
> `CODER_SUBDOMAIN` by your (sub)domain e.g. `coder.example.com`
126+
> Don't forget to change: `coder.example.com` by your (sub)domain
120127
121128
3. Test the configuration:
122129

@@ -151,4 +158,4 @@
151158
sudo systemctl restart nginx
152159
```
153160

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

0 commit comments

Comments
 (0)