2016-03-27 15 views
0

Çalışan bir yapılandırma var mı? Benimkini işe alamıyorum. Ben ampache git birinden kopyaladım ve ne düşündüğümü değiştirdim ama nginx başarıyla yeniden başlatamıyorum. Nginx'in varsayılan dosya ile çalıştığını biliyorum ama bununla değil? Herhangi bir fikir?Ampache nginx config

server { 
     listen 80; 
     listen [::]:80; 

    server_name mymedia.com; 
    charset utf-8; 

    # Logging, error_log mode [notice] is necessary for rewrite_log on, 
    # (very usefull if rewrite rules do not work as expected) 

     error_log  /var/log/ampache/error.log; # notice; 
     # access_log  /var/log/ampache/access.log; 
     # rewrite_log  on; 

    # only optional for ssl encryption enabled: Path to certificate/key 

     # ssl_certificate   /etc/ssl/certs/cert.crt; 
     # ssl_certificate_key  /etc/ssl/private/key.key; 

    root /var/www/ampache; 
    index index.php; 

    # Somebody said this helps, in my setup it doesn't prevent temporary saving in files 
    proxy_max_temp_file_size 0; 

    # Rewrite rule for Subsonic backend 
    if (!-d $request_filename) { 
     rewrite ^/rest/(.*).view$ /rest/index.php?action=$1 last; 
     rewrite ^/rest/fake/(.+)$ /play/$1 last; 
    } 

    # Rewrite rule for Channels 
    if (!-d $request_filename){ 
     rewrite ^/channel/([0-9]+)/(.*)$ /channel/index.php?channel=$1&target=$2 last; 
    } 

    # Beautiful URL Rewriting 
     rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&name=$5 last; 
     rewrite ^/play/ssid/(\w+)/type/(\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&name=$7 last; 
     rewrite ^/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/player/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4&client=$5&noscrobble=$6&player=$7&name=$8 last; 
     rewrite ^/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/client/(.*)/noscrobble/([0-1])/transcode_to/(w+)/bitrate/([0-9]+)/player/(.*)/name/(.*)$ /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 was needed for me to get downloads of single songs to work 
     rewrite ^/play/ssid/(.*)/type/(.*)/oid/([0-9]+)/uid/([0-9]+)/action/(.*)/name/(.*)$ /play/index.php?ssid=$1&type=$2&oid=$3&uid=$4action=$5&name=$6 last; 
     location /play { 
       if (!-e $request_filename) { 
       rewrite ^/play/art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /image.php?object_type=$2&object_id=$3&auth=$1; 
       break; 
       } 

     rewrite ^/([^/]+)/([^/]+)(/.*)?$ /play/$3?$1=$2; 
     rewrite ^/(/[^/]+|[^/]+/|/?)$ /play/index.php last; 
     break; 
     } 

    location /rest { 
     limit_except GET POST { 
     deny all; 
     } 
    } 

    location ^~ /bin/ { 
     deny all; 
     return 403; 
    } 

    location ^~ /config/ { 
     deny all; 
     return 403; 
    } 

    location/{ 
     limit_except GET POST HEAD{ 
     deny all; 
     } 
    } 

    location ~ ^/.*.php { 
     try_files $uri = 404; 
     fastcgi_index index.php; 

    # sets the timeout for requests in [s] , 60s are normally enough 
     fastcgi_read_timeout 600s; 

     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 

    # has to be set to on if encryption (https) is used: 
     # fastcgi_param HTTPS on; 

     fastcgi_split_path_info ^(.+?\.php)(/.*)$; 

    # chose as your php-fpm is configured to listen on 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     # fastcgi_pass 127.0.0.1:8000/; 
    } 

    # Rewrite rule for WebSocket 
    location /ws { 
     rewrite ^/ws/(.*) /$1 break; 
     proxy_http_version 1.1; 
     proxy_set_header Upgrade $http_upgrade; 
     proxy_set_header Connection "upgrade"; 
     proxy_set_header Host $host; 
     proxy_pass http://127.0.0.1:8100/; 
    } 
} 

cevap

0

Benim için sorun hata günlüğü klasörü /var/log/ampache/ oluşturma ile çözüldü. Daha fazla sorun giderme için (gerekirse) sudo nginx -c /etc/nginx/nginx.conf -t kullanın, bu size daha ayrıntılı hata mesajları verir. İyi şanslar!