diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-11-24 11:15:33 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-11-24 11:15:33 -0500 |
commit | 20a59da64e2177e4516596f20100fbb69d82e520 (patch) | |
tree | 8b0ea7a94010359b8f223f3acb4130bab908281a /configuration.md | |
parent | 7f24bc75df4c570d93798f6acfe453a80caf8d56 (diff) | |
download | sr.ht-docs-20a59da64e2177e4516596f20100fbb69d82e520.tar.gz |
Add API configuration to installation docs
Diffstat (limited to 'configuration.md')
-rw-r--r-- | configuration.md | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/configuration.md b/configuration.md index f31e45b..54d4df5 100644 --- a/configuration.md +++ b/configuration.md @@ -63,9 +63,62 @@ your unified `config.ini`. ## Service Files Service files for daemons are pre-configured by their distribution packages. - -Thus, after setting up your `config.ini` appropriately, you may start them -using your distribution's service manager (e.g., `service git.sr.ht start`). +After setting up your `config.ini` appropriately, you may start them using your +distribution's service manager (e.g., `service git.sr.ht start`). + +The list of daemons available for each service are documented on their +respective installation page. + +# Web services + +Most sr.ht services include a web component, and the standard installation +procedure requires you to configure a reverse proxy to serve them. A typical +nginx configuration may look something like this: + +``` +server { + listen 80; + server_name meta.sr.ht; + + location / { + return 302 https://$server_name$request_uri; + } + + location ^~ /.well-known { + root /var/www; + } +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name meta.sr.ht; + client_max_body_size 100M; + ssl_certificate /etc/ssl/uacme/meta.sr.ht/cert.pem; + ssl_certificate_key /etc/ssl/uacme/private/meta.sr.ht/key.pem; + + location / { + proxy_pass http://127.0.0.1:5000; + } + + location /query { + proxy_pass http://127.0.0.1:5100; + } + + location /static { + root /usr/lib/python3.8/site-packages/metasrht; + } +} +``` + +Note the following requirements: + +- Proxy `/` to the web application +- Serve static assets from `/static` (optional, but recommended) +- For many services, `/query` should be proxied to the API service + +See [sr.ht-nginx](https://git.sr.ht/~sircmpwn/sr.ht-nginx) for the nginx +configurations we use in production. # Databases |