toomuchio / plex-nginx-reverseproxy

Configuration to serve Plex Media Center https://plex.tv using Nginx https://nginx.com
663 stars 94 forks source link

Delete tests based on HTTP headers #22

Closed burkasaurusrex closed 7 years ago

burkasaurusrex commented 7 years ago

Plex recently added the root hit redirect into its server, rendering this unnecessary:

if ($request_method != OPTIONS) {
            set $test A;
        }
        if ($http_x_plex_device_name = '') {
            set $test "${test}B";
        }
        if ($arg_X-Plex-Device-Name = '') {
            set $test "${test}C";
        }
        if ($http_user_agent !~ (SmartTV)) {
            set $test "${test}D";
        }

        #If the client isn't an app like a SmartTV and such, forward them to the web interface.
        if ($test = ABCD) {
            rewrite ^/$ $scheme://$http_host/web/index.html;
        }
toomuchio commented 7 years ago

Finally! Thanks for this, you could have sent a pull request though :)