File size: 1,651 Bytes
df3ac6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
worker_processes 1;
daemon off;
pid /tmp/nginx.pid;
error_log /var/log/nginx/error.log warn;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;
    sendfile on;
    keepalive_timeout 65;

    # LibreTime Server Block
    server {
        listen 7860;
        server_name localhost;

        root /usr/share/libretime/legacy/public;
        index index.php index.html index.htm;

        client_max_body_size 512M;
        client_body_timeout 300s;

        location ~ \.php$ {
            fastcgi_buffers 64 4K;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            try_files $fastcgi_script_name =404;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            set $path_info $fastcgi_path_info;
            fastcgi_param PATH_INFO $path_info;
            fastcgi_pass 127.0.0.1:9000; # We will configure PHP-FPM to listen here
        }

        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ ^/api/(v2|browser) {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_redirect off;
            proxy_pass http://127.0.0.1:9001;
        }

        # Internal path for serving media files from the API.
        location /api/_media {
            internal;
            alias /srv/libretime;
        }
    }
}