Serve both files and directories

This commit is contained in:
Matteo Settenvini 2023-07-02 02:06:27 +02:00
parent 053854ce72
commit 9fa09de8df
3 changed files with 61 additions and 36 deletions

View file

@ -29,9 +29,31 @@ Then just configure Apache or NGINX to proxy to the given port. For example:
# ... other options ...
</VirtualHost>
```
You probably also want a systemd unit file, for instance `/etc/systemd/system/serves3@.service`:
```ini
[Unit]
Description=ServeS3, a S3 proxy
StartLimitInterval=100
StartLimitBurst=10
[Service]
Type=simple
ExecStart=/usr/local/bin/serves3
WorkingDirectory=/etc/serves3/%i/
Environment=ROCKET_PORT=%i
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target
```
Then, e.g. for running on port 8000, you would put the corresponding configuration file in `/etc/serves3/8000/` and install the unit with `systemctl enable --now servers3@8000.service`.
## Build and install
```bash