Net-FullAuto

 view release on metacpan or  search on metacpan

lib/Net/FullAuto/ISets/Local/Ampache_is.pm  view on Meta::CPAN

               rewrite ^/rest/(.\\x2A).view\\x24 /rest/index.php?action=\\x241 last;
               rewrite ^/rest/fake/(.+)\\x24 /play/\\x241 last;
            }

            # Rewrite rule for Channels
            if (\\x21-d \\x24request_filename){
               rewrite ^/channel/([0-9]+)/(.\\x2A)\\x24 /channel/index.php?channel=\\x241&target=\\x242 last;
            }

            # Beautiful URL Rewriting
               rewrite ^/play/ssid/(\\w+)/type/(\\w+)/oid/([0-9]+)/uid/([0-9]+)/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244&name=\\x245 last;
               rewrite ^/play/ssid/(\\w+)/type/(\\w+)/oid/([0-9]+)/uid/([0-9]+)/client/(.\\x2A)/noscrobble/([0-1])/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244&client=\\x245&noscrobble=\\x246&name=\\x247 last;
               rewrite ^/play/ssid/(.\\x2A)/type/(.\\x2A)/oid/([0-9]+)/uid/([0-9]+)/client/(.\\x2A)/noscrobble/([0-1])/player/(.\\x2A)/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244&client=\\x245&noscrobble=\\x246&pl...
               rewrite ^/play/ssid/(.\\x2A)/type/(.\\x2A)/oid/([0-9]+)/uid/([0-9]+)/client/(.\\x2A)/noscrobble/([0-1])/bitrate/([0-9]+)/player/(.\\x2A)/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244&client=\\x245&nos...
               rewrite ^/play/ssid/(.\\x2A)/type/(.\\x2A)/oid/([0-9]+)/uid/([0-9]+)/client/(.\\x2A)/noscrobble/([0-1])/transcode_to/(w+)/bitrate/([0-9]+)/player/(.\\x2A)/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244...

            # the following line was needed for me to get downloads of single songs to work
               rewrite ^/play/ssid/(.\\x2A)/type/(.\\x2A)/oid/([0-9]+)/uid/([0-9]+)/action/(.\\x2A)/name/(.\\x2A)\\x24 /play/index.php?ssid=\\x241&type=\\x242&oid=\\x243&uid=\\x244action=\\x245&name=\\x246 last;
            location /play {
                if (\\x21-e \\x24request_filename) {
                   rewrite ^/play/art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]\\x2A)\.([a-z]+)\\x24 /image.php?object_type=\\x242&object_id=\\x243&auth=\\x241 last;
                }

                rewrite ^/([^/]+)/([^/]+)(/.\\x2A)?\\x24 /play/\\x243?\\x241=\\x242;
                rewrite ^/(/[^/]+|[^/]+/|/?)\\x24 /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 ~ ^/.\\x2A.php {
                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 \\x24document_root\\x24fastcgi_script_name;

                # Mitigate HTTPOXY https://httpoxy.org/
                   fastcgi_param HTTP_PROXY \\x22\\x22;

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

                fastcgi_split_path_info ^(.+?\\x5C.php)(/.\\x2A)\\x24;

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

            # Rewrite rule for WebSocket
            location /ws {
                rewrite ^/ws/(.\\x2A) /\\x241 break;
                proxy_http_version 1.1;
                proxy_set_header Upgrade \\x24http_upgrade;
                proxy_set_header Connection \\x22upgrade\\x22;
                proxy_set_header Host \\x24host;
                proxy_pass http://127.0.0.1:8100/;
            }
        }

}
END

   ($stdout,$stderr)=$handle->cmd(
      "echo -e \"$nginx_conf\" > /usr/local/nginx/nginx.conf");

   #
   # echo-ing/streaming files over ssh can be tricky. Use echo -e
   #          and replace these characters with thier HEX
   #          equivalents (use an external editor for quick
   #          search and replace - and paste back results.
   #          use copy/paste or cat file and copy/paste results.):
   #
   #          !  -   \\x21     `  -  \\x60   * - \\x2A
   #          "  -   \\x22     \  -  \\x5C
   #          $  -   \\x24     %  -  \\x25
   #
   # https://www.lisenet.com/2014/ - bash approach to conversion
   my $nginx_start_stop=<<END;
#\\x21/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig:   - 85 15
# description:  Nginx is an HTTP(S) server, HTTP(S) reverse #               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /usr/local/nginx/nginx.conf
# pidfile:     /var/run/nginx.pid
# user:        www-data

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ \\x22\\x24NETWORKING\\x22 = \\x22no\\x22 ] && exit 0



( run in 1.035 second using v1.01-cache-2.11-cpan-71847e10f99 )