location PATHTOCHANGE { alias ALIASTOCHANGE; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } #enable subsonic api if ( !-d $request_filename ) { rewrite ^PATH2TOCHANGE/rest/(.*)\.view$ PATH2TOCHANGE/rest/index.php?action=$1 last; rewrite ^PATH2TOCHANGE/rest/fake/(.+)$ PATH2TOCHANGE/play/$1 last; } rewrite ^PATH2TOCHANGE/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/player/(.*)/name/(.*)$ PATH2TOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&player=$7&name=$8 last; rewrite ^PATH2TOCHANGE/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/bitrate/([0-9]+)/player/(.*)/name/(.*)$ PATH2TOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&bitrate=$7player=$8&name=$9 last; rewrite ^PATH2TOCHANGE/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/transcode_to/(w+)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ PATH2TOCHANGE/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 ^~ PATH2TOCHANGE/bin/ { deny all; return 403; } location ^~ PATH2TOCHANGE/config/ { deny all; return 403; } rewrite ^PATH2TOCHANGE/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ PATH2TOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last; rewrite ^PATH2TOCHANGE/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ PATH2TOCHANGE/play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 last; location PATH2TOCHANGE/rest { limit_except GET POST { deny all; } } # Include SSOWAT user panel. # include conf.d/yunohost_panel.conf.inc; }