Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caddy example for baseurl #221

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions _guides/reverse-proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ gzip_types application/javascript image/svg+xml text/css text/plain;

If you have [file uploads](/docs/configuration#fileupload) enabled in The Lounge, you may hit an issue when going over nginx's default upload limit, which will result in a 413 (Request Entity Too Large) error. To prevent this from happening, disable or increase [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size) variable.

If you have set [`baseUrl`](/docs/configuration#fileupload) option, then you will need to add extra configuration to proxy the upload urls.

If you set the `baseURL` to `https://example.com/folder/` then you need to add `location /folder/` to your nginx configuration:

```nginx
location /folder/ {
proxy_pass http://127.0.0.1:9000/uploads/;
proxy_set_header X-Forwarded-For $remote_addr;
}
```

Or if you use caddy, add the corresponding proxy to the example.com server block
```caddy
example.com {
proxy /folder/ http://127.0.0.1:9000/uploads {
without /folder
transparent
}
}
```

## [Apache](https://httpd.apache.org/)

Enable the necessary modules `a2enmod rewrite`, `a2enmod proxy`, `a2enmod proxy_http`, and `a2enmod proxy_wstunnel`.
Expand Down
28 changes: 17 additions & 11 deletions _includes/config.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DO NOT EDIT THIS FILE MANUALLY.
Content for the following is generated by this script in the main repo:
https://github.com/thelounge/thelounge/blob/master/scripts/generate-config-doc.js
Last updated at 2019-01-31 08:01:52 (UTC) by Pavel Djundik
Last updated at 2019-11-01 11:17:13 (UTC) by Pavel Djundik
-->

## Server settings
Expand Down Expand Up @@ -142,6 +142,12 @@ The available keys for the `fileUpload` object are:
this limit will be prompted with an error message in their browser. A value of
`-1` disables the file size limit and allows files of any size. **Use at
your own risk.** This value is set to `10240` kilobytes by default.
- `baseUrl`: If you want change the URL where uploaded files are accessed,
you can set this option to `"https://example.com/folder/"` and the final URL
would look like `"https://example.com/folder/aabbccddeeff1234/name.png"`.
If you use this option, you must have a reverse proxy configured,
to correctly proxy the uploads URLs back to The Lounge.
This value is set to `null` by default.

### `transports`

Expand Down Expand Up @@ -264,23 +270,23 @@ There are 2 ways to configure the `webirc` setting:

```json
webirc: {
"irc.example.net": "password1",
"irc.example.org": "passw0rd",
"irc.example.net": "thisiswebircpassword1",
"irc.example.org": "thisiswebircpassword2",
},
```

- **Advanced**: an object where keys are IRC hosts and values are functions
that take three arguments (`client`, `args`, `trusted`) and return an
object to be directly passed to `irc-framework`. For example:
that take two arguments (`webircObj`, `network`) and return an
object to be directly passed to `irc-framework`. `webircObj` contains the
generated object which you can modify. For example:

```js
webirc: {
"irc.example.net": (client, args, trusted) => ({
username: "thelounge",
password: "password1",
address: args.ip,
hostname: `webirc/${args.hostname}`
}),
"irc.example.com": (webircObj, network) => {
webircObj.password = "thisiswebircpassword";
webircObj.hostname = `webirc/${webircObj.hostname}`;
return webircObj;
},
},
```

Expand Down