From 9e0b43be0c9d7d2026d380eae6d931680066f416 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 11 May 2019 16:25:49 +0200 Subject: [PATCH] Ajouter 'ampache_nginx_config.conf' --- ampache_nginx_config.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ampache_nginx_config.conf diff --git a/ampache_nginx_config.conf b/ampache_nginx_config.conf new file mode 100644 index 0000000..b754dc5 --- /dev/null +++ b/ampache_nginx_config.conf @@ -0,0 +1,30 @@ +if ( !-d $request_filename ) { + rewrite ^/ampache/rest/(.*)\.view$ /ampache/rest/index.php?action=$1 last; + rewrite ^/ampache/rest/play/(.+)$ /ampache/play/$1 last; +} + + rewrite ^/ampache/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ xi/ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last; + rewrite ^/ampache/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ /ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 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; + +# The following line necessary for me to be able to download single songs +rewrite ^/ampache/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/action/(.*)/name/(.*)$ /ampache/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4action=$5&name=$6 last; + +# used for transfering art work to some clients, seems not to work for clementine because of an clementine-internal issue +location /ampache/play { + if (!-e $request_filename) { + rewrite ^/ampache/play/art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /ampache/image.php?object_type=$2&object_id=$3&auth=$1; + break; + } + rewrite ^/([^/]+)/([^/]+)(/.*)?$ /ampache/play/$3?$1=$2; + rewrite ^/(/[^/]+|[^/]+/|/?)$ /ampache/play/index.php last; + break; +} + +location /ampache/rest { + limit_except GET POST { + deny all; + } +}