Skip to content

Instantly share code, notes, and snippets.

@e-lie
Created August 16, 2017 20:42
Show Gist options
  • Save e-lie/b96fa856f24b3c6a7aa516bb94c0df3c to your computer and use it in GitHub Desktop.
Save e-lie/b96fa856f24b3c6a7aa516bb94c0df3c to your computer and use it in GitHub Desktop.
Yunohost nginx ampache config for DSUB to work
location /ampache/ {
alias /var/www/ampache/;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
rewrite ^/ampache/rest/(.*).view$ /ampache/rest/index.php?action=$1 last;
rewrite ^/ampache/rest/fake/(.+)$ /ampache/play/$1 last;
rewrite ^/ampache/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/player/(.*)/name/(.*)$ /ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&player=$7&name=$8 last;
rewrite ^/ampache/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&bitrate=$7player=$8&name=$9 last;
rewrite ^/ampache/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/transcode_to/(w+)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&transcode_to=$7&bitrate=$8&player=$9&name=$10 last;
index index.php;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location ^~ /ampache/bin/ {
deny all;
return 403;
}
location ^~ /ampache/config/ {
deny all;
return 403;
}
# Include SSOWAT user panel.
# include conf.d/yunohost_panel.conf.inc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment