Skip to content

Commit 45438c4

Browse files
authored
Update INSTALL.md
1 parent 57bbe45 commit 45438c4

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

INSTALL.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ tools/cli/ob passwd admin
6464

6565
8. Set up a service (or similar) to run required background tasks such as generating thumbnails and cache management. This service should ensure that `tools/cli/ob cron monitor` is running continuously.
6666

67+
9. To improve performance, set one of the OB_SENDFILE_HEADER following values in `config.php`. Ensure your web server and site configuration supports this (see Nginx example below).
68+
69+
```
70+
define('OB_SENDFILE_HEADER', 'X-Sendfile'); // set appropriate SENDFILE header based on server (apache)
71+
define('OB_SENDFILE_HEADER', 'X-Accel-Redirect'); // set appropriate SENDFILE header based on server (nginx)
72+
define('OB_SENDFILE_HEADER', 'X-LIGHTTPD-send-file'); // set appropriate SENDFILE header based on server (lighttpd)
73+
```
74+
6775
## Example Service
6876

6977
As an example for step 8, set up a service, `/etc/systemd/system/ob.service`, as follows. Be sure to update the `ExecStart` path and `User` as necessary.
@@ -92,3 +100,56 @@ systemctl enable ob
92100
systemctl start ob
93101
```
94102

103+
## Nginx Configuration
104+
105+
1. Make sure 'mjs' is added as an extension for application/javascript in `/etc/nginx/mime.types`:
106+
107+
```
108+
application/javascript js mjs;
109+
```
110+
111+
2. Use the following as a starting point for your site configuration, updating values as necessary:
112+
113+
```
114+
server {
115+
listen 80;
116+
server_name openbroadcaster.example.com;
117+
118+
root /home/openbroadcaster/www;
119+
index index.php;
120+
121+
location / {
122+
try_files $uri $uri/ =404;
123+
}
124+
125+
# disallow access to files and directories starting with a period
126+
location ~ /\. {
127+
deny all;
128+
access_log off;
129+
log_not_found off;
130+
}
131+
132+
# php file handling
133+
location ~ \.php$ {
134+
include snippets/fastcgi-php.conf;
135+
fastcgi_pass unix:/run/php/php8.3-openbroadcaster-fpm.sock;
136+
fastcgi_buffer_size 32k;
137+
fastcgi_buffers 8 32k;
138+
fastcgi_busy_buffers_size 64k;
139+
}
140+
141+
# rewrite for API URLs
142+
location ^~ /api/ {
143+
try_files $uri $uri/ /api.php$is_args$args;
144+
}
145+
146+
# allow access to files via X-Accel-Redirect
147+
location /home/openbroadcaster/files/ {
148+
internal;
149+
alias /home/openbroadcaster/files/;
150+
}
151+
152+
# allow larger data posts and file uploads
153+
client_max_body_size 1024M;
154+
}
155+
```

0 commit comments

Comments
 (0)