forked from koel/koel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf.example
43 lines (34 loc) · 1.27 KB
/
nginx.conf.example
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
server {
listen *:80;
server_name koel.dev;
root /var/www/koel;
index index.php;
gzip on;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json;
gzip_comp_level 9;
# Whitelist only index.php, robots.txt, and those start with public/ or api/ or remote
if ($request_uri !~ ^/$|index\.php|robots\.txt|api/|public/|remote) {
return 404;
}
location /media/ {
internal;
# A 'X-Media-Root' should be set to media_path settings from upstream
alias $upstream_http_x_media_root;
#access_log /var/log/nginx/koel.access.log;
#error_log /var/log/nginx/koel.error.log;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}