Skip to content

Commit

Permalink
Merge pull request #258 from A5hleyRich/master
Browse files Browse the repository at this point in the history
Update Running Fathom with NGINX doc
  • Loading branch information
JackEllis authored Feb 14, 2020
2 parents ed7dd42 + c084d99 commit 69baac5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/misc/NGINX.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,39 @@ server {
}
```

If you wish to protect your site using a [Let's Encrypt](https://letsencrypt.org/) HTTPS certificate, you can do so using the [Certbot webroot plugin](https://certbot.eff.org/docs/using.html#webroot).

```
certbot certonly --webroot --webroot-path /var/www/yourfathom.com -d yourfathom.com
```

Your `/etc/nginx/sites-enabled/yourfathom.com` file should be updated accordingly:

```
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourfathom.com;
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;
location /.well-known {
alias /var/www/yourfathom.com/.well-known;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:9000;
}
}
```

The `alias` directive should point to the location where your `--webroot-path` is specified when generating the certificate (with `/.well-known` appended).

### Test NGINX configuration
```
sudo nginx -t
Expand Down

0 comments on commit 69baac5

Please sign in to comment.