title: Rewrite plex media server url on nginx?
body: <p>I have very limited knowledge with rewriting url in nginx. I have a plex media server running behind on nginx, i can access the dashboard with <a href="http://domain.com/web/index.html" rel="nofollow">http://domain.com/web/index.html</a> with these config i found on github:</p>
  
  <pre><code>upstream plex-upstream {
      server plex-server.example.com:32400;
  }
  
  server {
  listen 80;
  server_name domain.com
  
      location / {
                  if ($http_x_plex_device_name = '') {
                        rewrite ^/$ http://$http_host/web/index.html;
  }
  
              proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  proxy_redirect off;
  
                  proxy_set_header Host $http_host;
              proxy_pass http://plex-upstream;
  }
  }
  </code></pre>
  
  <p>What i want is to remove /web/index.html so when i go to <a href="http://domain.com" rel="nofollow">http://domain.com</a>, the PMS dashboard will load. I tried some one liner rewrite rules already but all failed. Thanks.</p>