Skip to content

Instantly share code, notes, and snippets.

@m1m1s1ku
Last active May 3, 2016 00:26
Show Gist options
  • Save m1m1s1ku/f46252d13a1bfdd4437b48a9d7f081e8 to your computer and use it in GitHub Desktop.
Save m1m1s1ku/f46252d13a1bfdd4437b48a9d7f081e8 to your computer and use it in GitHub Desktop.
Koel config for Nginx (Tuto : http://ghostfly.github.io/Install-Koel-on-Debian/)
server {
listen 80;
server_name koel.ndd.tld;
return 301 https://koel.ndd.tld$request_uri;
}
server {
listen 443 ssl http2;
# Without HTTP2
#listen 443 ssl;
server_name koel.ndd.tld;
root /var/www/koel;
index index.php;
ssl_certificate /etc/letsencrypt/live/koel.ndd.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/koel.ndd.tld/privkey.pem;
# Deny access to dotfiles
location ~ /\. {
deny all;
}
# Deny access to framework directories
location ~ /(app|bootstrap|config|database|resources|storage|tests|vendor|node_modules)/ {
deny all;
}
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;
# PHP7
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# PHP5
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment