Ombi: Add a URL Base option

Created on 22 Mar 2016  Â·  118Comments  Â·  Source: tidusjar/Ombi

Sonarr and CouchPotato both have options for URL Bases. I'm using a NGINX reverse proxy. When I go to mydomain.com/requests it immediately changes the URL to mydomain.com/userlogin and gives me a 404 page. I'm not 100% sure that a URL Base is what we need to resolve my issues, but it appears it is something this app needs.

question

Most helpful comment

@mescon I'm looking into the issue. We should have it resolved very soon.

All 118 comments

I've done all the work on this and it will be in the next release.

So, since it's redirecting you, where would you expect it to go? mydomain.com/requests/userlogin?

@Logvin Does this link help? https://github.com/NancyFx/Nancy/wiki/Hosting-Nancy-with-Nginx-on-Ubuntu#install-nginx

PlexRequests.Net is using the Nancy framework.

I'm waiting for this until I migrate from the meteor version :-)

@mescon do you have the same issue as @Logvin ?

No, that hasn't been verified, but I do run all of my services behind an nginx reverse proxy and decided to hold off on moving to PR.Net until I saw that this issue was resolved.
I've been banging my head on this on several other applications - nzbhydra, couchpotato, pydio, headphones and so on... some were fixed by the authors, others I've patched myself, though I don't know the first thing about .NET development, so I hoped to just see this issue closed before trying anything in mono :-)

@mescon What does the meteor version do to fix this issue?

I run it with:
ROOT_URL=http://localhost/requests meteor
... as opposed to:
meteor

So then everything runs under /requests e.g. /requests/admin ?

yeah exactly..., so for my nginx I just do (proxy-control.conf is just some authentication and other stuff)

location /requests {
        proxy_pass http://localhost:3000/requests;
        include         proxy/proxy-control.conf;
}

The important thing is to make sure all clickable items/urls/images/css/js are all with relative paths and NOT absolute paths ../images/bla.png instead of /images/bla.png as that would lead to http://whatever.com/images/bla.png when it is supposed to be http://whatever.com/requests/images/bla.png

The URL did not help, unfortunately. I have NGINX set up and working with CouchPotato and Sonarr no problem.

I think @mescon has it right... you are using absolute paths, not relative paths.

I'm going to create a separate branch to be able to test the fix for this (I do not want to make the changes in the main code yet). Once this is complete are you happy to try it out?

Here is the custom build that has attempted to fix this, please let me know how you get on. If this works I will merge it into the mail codebase.

https://ci.appveyor.com/project/tidusjar/requestplex/build/1.4.50/artifacts

I'm testing 1.4.54 on this branch; 1.4.50 did not appear to have any changes supporting redirects, unless I'm mistaken.

When I launched the app, the console displays "Request Plex is running on the following: http://+:3579/"

I assume this string was changed from previous versions to allow subdir support for Plex Requests itself, but there is no setting in the administration pane, and I could not find a configuration file to specify this. Where do we set the base path/subdir for Plex Requests itself?

One note on usability: When configuring Couchpotato with the IP/port correct, but the subdirectory not correct, the error supplied is:
Could not connect to CouchPotato, please check your settings. Exception Message: 'doctype' is an unexpected token. The expected token is 'DOCTYPE'. Line 2, position 3.
Perhaps this could be handled more eloquently.

After correcting this, CouchPotato worked fine.

Sonarr, on the other hand claimed to connect successfully with or without the SubDir. This is because Sonarr builds in a redirect at /, I guess. Neat. I thought I was still having issues after this, but it turns out my "Root save directory" was not a valid path. "Something went wrong"; perhaps, at very least, this path should be tested for validity to some degree. Once this was corrected, Sonarr worked correctly with/without the subdirectory specified.

Hello, the build 1.4.54 is the latest Development branch and is not stable. The build I provided above has specific changes to how we are redirecting content and hopefully will get around the subdir issue.
I am hoping this build will fix the issue posted here: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.4.50/artifacts

The couchpotato error is difficult to handle as it can vary, the reason it complains about the doctype is because it's attempting to parse JSON but it's got HTML back as it's not the correct endpoint.

I agree there could be better error handling with the Something went wrong and we could test the root save directory.

I should have some time tonight (10 hours from this post) to test this out. I'll install the test build and provide feedback.

@Logvin Thanks. That would help a lot.

I installed the 1.4.50 build first, but it doesn't appear to have any options for specifying the SubDir for PlexRequests, or for any of the services interfacing with PlexRequests. Using this build, how am I supposed to set SubDirs for any of these things?

@ruricu Correct, there are no options, it should just work with whatever path you run it under (or virtual directory).

If it's set up using nginx to run under http://localhost:4000/requests it should now redirect you to http://localhost:4000/requests/userlogin :pray:

For one reason or another, I've been using WAMP/Apache handling my reverse proxies. To this end, a configuration like this has been sufficient:

<VirtualHost *:80>
    ServerName my.domain.here
    ProxyPass /sonarr http://localhost:8989/sonarr
    ProxyPassReverse /sonarr/ http://localhost:8989/sonarr
</VirtualHost>

After some trial and error, the only partially-functional configuration I could find for PR.Net is:

<VirtualHost *:80>
    ServerName my.domain.here
    ProxyPass /req/ http://localhost:3579/
    <Location /req/>
        ProxyPassReverse /
    </Location>
</VirtualHost>

I say "partial" in that mydomain.here/req/ correctly redirects to my.domain.here/req/userlogin and displays the basic login page, but all formatting/css/images are missing. Attempting to log in remains on my.domain.here/req/userlogin, but displays only the JSON response {"result":true, "message":null}. Every other link on the page does not respect the relative subdir paths.

It seems to me like this implementation is more obscure than what exists in the original PlexRequests, PlexPy, HtpcManager, Sonarr, SickRage, CouchPotato; where an explicit basepath is set in the app's configuration and, after restart, this is where the app is accessible, regardless of your proxy configuration. Is this intended to be more user-friendly than all of its predecessor and partner apps?

Thank you for your feedback. I did not start this to make it 'more user-friendly', I started it because I wanted to try out a new .Net framework (Nancy). I admit that my experience with Nancy is lacking, but this is the primary reason for me doing this project (you know, all of this work is also done in my spare time). If you are finding it more 'obscure' there is nothing stopping you from using the original version of Plex Requests.

Thanks.

Just for the record.... it doesnt work in the original version of PlexRequests either, and the work you are doing here is flat out amazing. I really appreciate your work on this and will be looking for a way to donate as soon as my next paycheck comes :)

Thank you @Logvin I have left an issue with the guys at Nancy, they have been amazing assisting me with some of the issues i've had. Hopefully they will be able to point me in the right direction to get this working for you.

@tidusjar I'm sorry that my feedback came across as dismissive or condescending. That was truly nowhere near my intent. I am genuinely excited about the additional features you've implemented here as compared to the original PlexRequests.

What I was trying to convey is that you seem to be "divining" a url base from an external request in a way that is unique to your project when compared to the explicit configuration used in various "sister" applications. From a user-experience perspective, I think someone familiar with these sister applications might be confused to find this explicit configuration missing, and as a result, the asymmetry in the url base for internal and external addressing of this service. It is precisely because of this asymmetry that a simplistic apache mod_proxy does not function. In terms of "user friendliness" and "obscurity", I was merely referring to the configuration of url base functionality, not the PlexRequests.Net project as a whole.

Again; sorry to offend, and thanks for your hard work.

So what I do is run the Nancy self host on 127.0.0.1 and then nginx to proxy calls. That way the Nancy app isnt exposed to the world.

var options = new StartOptions();
var urls = new[] { "http://127.0.0.1:1234", "http://localhost:1234" };
urls.ToList().ForEach(options.Urls.Add);

using (WebApp.Start<Startup>(options))
{
    Console.WriteLine("Running a http server on {0}", options.Urls.Aggregate((a, b) => a + ", " + b));
    do
    {
        Thread.Sleep(60000); //Required as Linux won't work for ReadKey
    } while (!Console.KeyAvailable);
}

Here's my nginx conf. Now bear in mind this has a load of SSL stuff which you probably don't need just to get a simple demo going but this all works in production.

daemon off;
worker_processes 1;

events {
    worker_connections 1024;
}

http {
    keepalive_timeout 65;

    server_tokens off;

    client_max_body_size 200m;
    client_body_timeout 300s;
    client_header_timeout 5s;

    large_client_header_buffers 2 4k;

    limit_req_zone $binary_remote_addr zone=vq:10m rate=400r/s;


    server {
        listen 80;
        return 301 https://$host$request_uri;
        add_header X-Frame-Options DENY;
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1;mode=block";
    }

    server {
        listen 443;
        limit_req zone=vq burst=5;
        ssl_certificate     /certs/nginx.crt;
        ssl_certificate_key /certs/nginx.key;
        ssl on;
        ssl_session_cache builtin:1000 shared:SSL:10m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
        ssl_prefer_server_ciphers on;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
        add_header X-Frame-Options DENY;
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1;mode=block";

        access_log /logs/nginx.log;
        error_log /logs/nginxerrors.log debug;

        location / {

            gzip  on;
            gzip_http_version 1.1;
            gzip_vary on;
            gzip_comp_level 6;
            gzip_proxied any;
            gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml
            application/xml+rss text/javascript application/javascript text/x-js;
            gzip_buffers 16 8k;
            gzip_disable "MSIE [1-6]\.(?!.*SV1)";

            proxy_buffering off;

            proxy_connect_timeout 90;
            proxy_send_timeout 90;
            proxy_read_timeout 90;

            proxy_set_header Host "localhost";
            proxy_set_header X-Host $host$request_uri;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;



            proxy_pass http://localhost:1924;
        }
    }
}

Thanks for the help @jchannon does this work for anyone else?

@jchannon I gotta admit, what you are doing is a bit above my head.

Here is what I have in my NGINX.conf file:

  location /Requests {
        proxy_pass http://127.0.0.1:3579;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    location /CouchPotato {
        proxy_pass https://127.0.0.1:5050;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

Right now, when I go to domain.com/couchpotato, it loads couchpotato great. When I go to domain.com/requests, the URL is immediately changed to domain.com/userlogin and I get 404. This setup works great for Sonarr and CouchPotato.

@tidusjar I just installed the custom build you made, it did not help the redirect issue. When I go to domain.com/requests, the URL is immediately changed to domain.com/userlogin

Thanks for confirming that @logvin .
@jchannon it seems that the issue is I am redirecting them to /uselogin/ when they are not logged in

I think the nginx conf should proxy all requests not have separate location
configs. Try that first and see how you go

On Friday, 25 March 2016, Jamie [email protected] wrote:

Thanks for confirming that @logvin https://github.com/logvin .
@jchannon https://github.com/jchannon it seems that the issue is I am
redirecting them to /uselogin/ when they are not logged in

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-201236829

Try this:

worker_processes 4;

events { worker_connections 1024; }

http {
upstream web-app {
server webapp1:5090;
server webapp2:5090;
}

server {
  listen 80;

  location / {
    proxy_pass http://web-app;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection keep-alive;
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}

}

On Friday, 25 March 2016, Jonathan Channon jonathan.[email protected]
wrote:

I think the nginx conf should proxy all requests not have separate
location configs. Try that first and see how you go

On Friday, 25 March 2016, Jamie <[email protected]

Thanks for confirming that @logvin https://github.com/logvin .
@jchannon https://github.com/jchannon it seems that the issue is I am
redirecting them to /uselogin/ when they are not logged in

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-201236829

So I moved over to this version from the Meteor version as well, mainly because I got tired of pounding my head on it for the same issue, and liking the direction you were going with adding features.I'll see if I can describe what's going on so far.

My nginx config for this application:
location /requests {
proxy_pass http://192.168.1.27:3579;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

When I visit http://192.168.1.27/requests/ I get the page, but nothing else loads. No .js and no .css

So in the nginx access logs I see stuff like this:

192.168.1.189 - admin [06/Apr/2016:13:27:03 -0400] "GET /Content/site.js HTTP/1.1" 404 156 "http://192.168.1.27/requests/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" 192.168.1.189 - admin [06/Apr/2016:13:27:03 -0400] "GET /Content/pace.min.js HTTP/1.1" 404 156 "http://192.168.1.27/requests/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" 192.168.1.189 - admin [06/Apr/2016:13:27:03 -0400] "GET /Content/jquery.mixitup.js HTTP/1.1" 404 156 "http://192.168.1.27/requests/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" 192.168.1.189 - admin [06/Apr/2016:13:27:03 -0400] "GET /Content/moment.min.js HTTP/1.1" 404 156 "http://192.168.1.27/requests/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0" 192.168.1.189 - admin [06/Apr/2016:13:27:03 -0400] "GET /Content/requests.js HTTP/1.1" 404 156 "http://192.168.1.27/requests/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"

And in the nginx error logs I see this:

2016/04/06 13:27:03 [error] 2463#0: *9 open() "/usr/share/nginx/html/Content/jquery.mixitup.js" failed (2: No such file or directory), client: 192.168.1.189, server: , request: "GET /Content/jquery.mixitup.js HTTP/1.1", host: "192.168.1.27", referrer: "http://192.168.1.27/requests/" 2016/04/06 13:27:03 [error] 2463#0: *9 open() "/usr/share/nginx/html/Content/moment.min.js" failed (2: No such file or directory), client: 192.168.1.189, server: , request: "GET /Content/moment.min.js HTTP/1.1", host: "192.168.1.27", referrer: "http://192.168.1.27/requests/" 2016/04/06 13:27:03 [error] 2463#0: *9 open() "/usr/share/nginx/html/Content/requests.js" failed (2: No such file or directory), client: 192.168.1.189, server: , request: "GET /Content/requests.js HTTP/1.1", host: "192.168.1.27", referrer: "http://192.168.1.27/requests/"
I can play with the settings in the location block, mainly adding and removing trailing / from the address and get different results, but nothing that loads the whole thing.

@jchannon How does Nancy deal with static content when using this method?

I think you are limiting your requests by an endpoint in nginx and I'm not
sure why. It should be at the front of the whole of your app. Remove the
/requests in the config and just make it /

On Wednesday, 6 April 2016, Jamie [email protected] wrote:

@jchannon https://github.com/jchannon How does Nancy deal with static
content when using this method?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206499268

Well, I'm setting this up to act as a reverse proxy so I can hit a bunch of internal apps through one host/port. I can try removing it and see what it does at root.

Also shouldnt you be visiting the app via the nginx IP address which should
different to the ip your Nancy app is on?

On Wednesday, 6 April 2016, Jonathan Channon jonathan.[email protected]
wrote:

I think you are limiting your requests by an endpoint in nginx and I'm
not sure why. It should be at the front of the whole of your app. Remove
the /requests in the config and just make it /

On Wednesday, 6 April 2016, Jamie <[email protected]

@jchannon https://github.com/jchannon How does Nancy deal with static
content when using this method?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206499268

So making it the root does work with the exact nginx code block I used above.

But how do I get it working as a /requests option. :) In the end, I want it to be behind a sub-directory so its not the first thing people see when hitting my IP on port 80.

Also shouldnt you be visiting the app via the nginx IP address which should different to the ip your Nancy app is on?

Actually, in this case the app and nginx are on the same server. Just going to use nginx as the front end for reverse proxying everything.

I guess in theory if your views ask for a relative /content/my.css it
should relate to http://nginx/requests/content/my.css ?

On Wednesday, 6 April 2016, Craig [email protected] wrote:

Also shouldnt you be visiting the app via the nginx IP address which
should different to the ip your Nancy app is on?

Actually, in this case the app and nginx are on the same server. Just
going to use nginx as the front end for reverse proxying everything.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206516644

I think so?

I can see in the logs its like nginx is looking in its own root for the files instead of the "root" for the app like in this entry: "/usr/share/nginx/html/Content/moment.min.js

Htm. I just notcied that internally there is a reuqests page. I wonder if it was getting confused with my naming. Let me try naming the proxy something else.

Nope, no difference. But I'll try naming it something else in the future just in case it should cause issues.

Ok for more info that might help, and where I think the idea of a base_url option comes in.

When I try 192.168.1.27/test I get:

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:45 GMT
Content-Type: text/html
Content-Length: 184
Location: http://192.168.1.27/test/
Connection: keep-alive

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/
HTTP/1.1 303 See Other
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:57 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Location: /userlogin

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/userlogin
HTTP/1.1 404 Not Found
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:15 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
ETag: "57041dc5-91"

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/userlogin
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:21 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Vary: Accept

You can see how it progresses and forwards me around till I get 404'ed, and then if I manually correct it by putting /test in the URL again, it works.

So going to the browser and visiting http://192.168.1.27/test/userlogin in the page source in the head I get:

<head>
    <title>Plex Requests</title>
    <!-- Styles -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/Content/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="/Content/custom.min.css" type="text/css" />
    <link rel="stylesheet" href="/Content/font-awesome.css" type="text/css"/>
    <link rel="stylesheet" href="/Content/pace.min.css" type="text/css"/>


    <!-- Scripts -->
    <script src="/Content/jquery-2.2.1.min.js"></script>
    <script src="/Content/handlebars.min.js"></script>
    <script src="/Content/bootstrap.min.js"></script>
    <script src="/Content/bootstrap-notify.min.js"></script>
    <script src="/Content/site.js"></script>
    <script src="/Content/pace.min.js"></script>
    <script src="/Content/jquery.mixitup.js"></script>
    <script src="/Content/moment.min.js"></script>
</head>
<body>

So when the page reaches out to get the css and js, nginx doesn't match a site with "/test" at the beginning, so it tries to serve from the root / of the site. So I get a half working page. The userlogin stuff is there, but no js or css.

Does this help any?

Try changing it to ~/Content

On Wednesday, 6 April 2016, Craig [email protected] wrote:

Ok for more info that might help, and where I think the idea of a base_url
option comes in.

When I try 192.168.1.27/test I get:

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test
HTTP/1.1 http://192.168.1.27/testHTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:45 GMT
Content-Type: text/html
Content-Length: 184
Location: http://192.168.1.27/test/
Connection: keep-alive

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/
HTTP/1.1 http://192.168.1.27/test/HTTP/1.1 303 See Other
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:57 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Location: /userlogin

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/userlogin
HTTP/1.1 http://192.168.1.27/userloginHTTP/1.1 404 Not Found
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:15 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
ETag: "57041dc5-91"

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/userlogin
HTTP/1.1 http://192.168.1.27/test/userloginHTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:21 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Vary: Accept

You can see how it progresses and forwards me around till I get 404'ed,
and then if I manually correct it by putting /test in the URL again, it
works.

So going to the browser and visiting http://192.168.1.27/test/userlogin
in the page source in the head I get:


Plex Requests





<!-- Scripts -->
<script src="/Content/jquery-2.2.1.min.js"></script>
<script src="/Content/handlebars.min.js"></script>
<script src="/Content/bootstrap.min.js"></script>
<script src="/Content/bootstrap-notify.min.js"></script>
<script src="/Content/site.js"></script>
<script src="/Content/pace.min.js"></script>
<script src="/Content/jquery.mixitup.js"></script>
<script src="/Content/moment.min.js"></script>


So when the page reaches out to get the css and js, nginx doesn't match a
site with "/test" at the beginning, so it tries to serve from the root / of
the site. So I get a half working page. The userlogin stuff is there, but
no js or css.

Does this help any?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206530449

In your cshtml file that is

On Wednesday, 6 April 2016, Jonathan Channon jonathan.[email protected]
wrote:

Try changing it to ~/Content

On Wednesday, 6 April 2016, Craig <[email protected]

Ok for more info that might help, and where I think the idea of a
base_url option comes in.

When I try 192.168.1.27/test I get:

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test
HTTP/1.1 http://192.168.1.27/testHTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:45 GMT
Content-Type: text/html
Content-Length: 184
Location: http://192.168.1.27/test/
Connection: keep-alive

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/
HTTP/1.1 http://192.168.1.27/test/HTTP/1.1 303 See Other
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:43:57 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Location: /userlogin

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/userlogin
HTTP/1.1 http://192.168.1.27/userloginHTTP/1.1 404 Not Found
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:15 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
ETag: "57041dc5-91"

root@debian:/etc/nginx/sites-enabled# curl -I http://192.168.1.27/test/userlogin
HTTP/1.1 http://192.168.1.27/test/userloginHTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Wed, 06 Apr 2016 19:44:21 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Vary: Accept

You can see how it progresses and forwards me around till I get 404'ed,
and then if I manually correct it by putting /test in the URL again, it
works.

So going to the browser and visiting http://192.168.1.27/test/userlogin
in the page source in the head I get:


Plex Requests





<!-- Scripts -->
<script src="/Content/jquery-2.2.1.min.js"></script>
<script src="/Content/handlebars.min.js"></script>
<script src="/Content/bootstrap.min.js"></script>
<script src="/Content/bootstrap-notify.min.js"></script>
<script src="/Content/site.js"></script>
<script src="/Content/pace.min.js"></script>
<script src="/Content/jquery.mixitup.js"></script>
<script src="/Content/moment.min.js"></script>


So when the page reaches out to get the css and js, nginx doesn't match a
site with "/test" at the beginning, so it tries to serve from the root / of
the site. So I get a half working page. The userlogin stuff is there, but
no js or css.

Does this help any?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206530449

That one I'll have to leave for @tidusjar :)

Out of interest try hitting http://nginx/proxyurl/content/my.css to see
what happens

On Wednesday, 6 April 2016, Craig [email protected] wrote:

That one I'll have to leave for @tidusjar https://github.com/tidusjar
:)

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206531608

Ah good point. Give me an hour or so to get home and I'll make the change for you.

Accessing http://192.168.1.27/test/Content/pace.min.css gives me a result.

.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;}.pace-inactive{display:none;}.pace .pace-progress{background:#ffa400;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px;}

Yup makes sense. Hopefully the cshtml change will do the trick

On Wednesday, 6 April 2016, Craig [email protected] wrote:

Hitting http://192.168.1.27/Content/pace.min.css gives me a 404

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206544114

@jchannon I have changed the .cshtml to the following (all the stylesheets was already ~/)

    <script src="~/Content/moment.min.js"></script>

But when I look at the markup it's

    <script src="/Content/moment.min.js"></script>

Does nancy do anything with this?

Could it be that you are hosting on the root, so its ignoring it? Maybe it needs to be pointed at from a sub directory.

A tilde should output the correct path to the file from root I believe so
if it's what you expect then we're good to go. Just need to workout why
we're not getting the full nginx url when seeing the view

On Thursday, 7 April 2016, Craig [email protected] wrote:

Could it be that you are hosting on the root, so its ignoring it? Maybe it
needs to be pointed at from a sub directory.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206628909

Could it be looking for ./ instead of ~/ ?

Sent from my iPhone

On Apr 7, 2016, at 5:18 PM, Jonathan Channon [email protected] wrote:

A tilde should output the correct path to the file from root I believe so
if it's what you expect then we're good to go. Just need to workout why
we're not getting the full nginx url when seeing the view

On Thursday, 7 April 2016, Craig [email protected] wrote:

Could it be that you are hosting on the root, so its ignoring it? Maybe it
needs to be pointed at from a sub directory.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-206628909

—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@SaskiFX The latest Dev build contains all of the Scripts using ~/ do you want to try it to test on your system? If you do let me know and I will provide you with the .zip location

Yes please. I'll be heading out to dinner in a bit, but when I get home I'll be happy to download and test.

Alright, so I tried the dev build and didn't have any success.

I found the _Layout.cshtml file and started playing with the options.

These didn't work:

<script src="Content/moment.min.js"></script>
<script src="/Content/moment.min.js"></script>
<script src="~/Content/moment.min.js"></script>
<script src="./Content/moment.min.js"></script>

However, I went in and edited in this:
<script src="/test/Content/moment.min.js"></script>

And with the right nginx config:

location /test/ {
proxy_pass http://192.168.1.27:3579/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

I get a result! The search.js doesn't load, but all the css and js in the Content folder does.

When I go and relate this to sonarr and the base_url option, it looks like it just adds the appropriate leading part to the URL.

Standard sonarr config I hit the site (ie. 192.168.0.1:8080) and it just loads on the root. Once I set the base_url (setting it to sonarr for example) it loads on 192.168.0.1:8080/sonarr (

So in nginx I can just set the config like this:

location /sonarr {
proxy_pass http://192.168.1.24:8989;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Setting it up without the trailing slashes on the location line and the proxy_pass line and it works great.

Does any of this help? :)

So I just need to prepend something onto the scripts and styles?

Depends, do you think its something you need to do, or is it an option you can pass to whatever you are serving the files with, kind of like the port number on the command line?

Not sure.

@SaskiFX You read my mind. I have done it. Can you please test it out? You will need a fresh database (Just for now, once I know this works i'll implement it properly to work with the existing db).

Usage:

PlexRequests.exe -base test

Where test is your base location (Test is used in your nginx config above).

location /test/ 

If this works I'll allow it via the command line and also add it to the settings page.

Build: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.6.242/artifacts

It goes all explody on me.

root@debian:~# /usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base test 3579
Settings URL Base
Version: 1.6.0
Location of the database: /opt/PlexRequests/Release/PlexRequests.sqlite
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method 'Array.Empty' not found.
  at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].Initialise () <0x408cfdc0 + 0x0019a> in <filename unknown>:0
  at Nancy.Owin.NancyMiddleware.UseNancy (Nancy.Owin.NancyOptions options) <0x408cfba0 + 0x000e6> in <filename unknown>:0
  at Owin.AppBuilderExtensions.UseNancy (IAppBuilder builder, Nancy.Owin.NancyOptions options) <0x408c8b20 + 0x00053> in <filename unknown>:0
  at PlexRequests.UI.Startup.Configuration (IAppBuilder app) <0x408c89b0 + 0x0001f> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f1b189ab960 + 0x000ef> in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7f1b187e3ec0 + 0x0002a> in <filename unknown>:0
  at Owin.Loader.DefaultLoader+<>c__DisplayClass12.<MakeDelegate>b__b (IAppBuilder builder) <0x408c8930 + 0x00076> in <filename unknown>:0
  at Owin.Loader.DefaultLoader+<>c__DisplayClass1.<LoadImplementation>b__0 (IAppBuilder builder) <0x408c8800 + 0x000e6> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp (Microsoft.Owin.Hosting.Engine.StartContext context) <0x408c1ae0 + 0x00230> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext context) <0x408b4bb0 + 0x00147> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b3de0 + 0x0005c> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b2900 + 0x0007b> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.StartImplementation (IServiceProvider services, Microsoft.Owin.Hosting.StartOptions options) <0x408b22d0 + 0x0005e> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b0fd0 + 0x00027> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.Start[TStartup] (Microsoft.Owin.Hosting.StartOptions options) <0x408b0ee0 + 0x00047> in <filename unknown>:0
  at PlexRequests.UI.Program.Main (System.String[] args) <0x40736660 + 0x0034f> in <filename unknown>:0
root@debian:~#

I tried running with just the -base option, and just the port, and both fail with the same error.

That looks like a Nancy CI version? If you can track it down let us know
https://github.com/NancyFx/Nancy/issues/2396

On Friday, 8 April 2016, Craig [email protected] wrote:

It goes all explody on me.

root@debian:~# /usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base test 3579
Settings URL Base
Version: 1.6.0
Location of the database: /opt/PlexRequests/Release/PlexRequests.sqlite
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method 'Array.Empty' not found.
at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].Initialise () <0x408cfdc0 + 0x0019a> in :0
at Nancy.Owin.NancyMiddleware.UseNancy (Nancy.Owin.NancyOptions options) <0x408cfba0 + 0x000e6> in :0
at Owin.AppBuilderExtensions.UseNancy (IAppBuilder builder, Nancy.Owin.NancyOptions options) <0x408c8b20 + 0x00053> in :0
at PlexRequests.UI.Startup.Configuration (IAppBuilder app) <0x408c89b0 + 0x0001f> in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f1b189ab960 + 0x000ef> in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7f1b187e3ec0 + 0x0002a> in :0
at Owin.Loader.DefaultLoader+<>c__DisplayClass12.b__b (IAppBuilder builder) <0x408c8930 + 0x00076> in :0
at Owin.Loader.DefaultLoader+<>c__DisplayClass1.b__0 (IAppBuilder builder) <0x408c8800 + 0x000e6> in :0
at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp (Microsoft.Owin.Hosting.Engine.StartContext context) <0x408c1ae0 + 0x00230> in :0
at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext context) <0x408b4bb0 + 0x00147> in :0
at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b3de0 + 0x0005c> in :0
at Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b2900 + 0x0007b> in :0
at Microsoft.Owin.Hosting.WebApp.StartImplementation (IServiceProvider services, Microsoft.Owin.Hosting.StartOptions options) <0x408b22d0 + 0x0005e> in :0
at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions options) <0x408b0fd0 + 0x00027> in :0
at Microsoft.Owin.Hosting.WebApp.StartTStartup <0x408b0ee0 + 0x00047> in :0
at PlexRequests.UI.Program.Main (System.String[] args) <0x40736660 + 0x0034f> in :0
root@debian:~#

I tried running with just the -base option, and just the port, and both
fail with the same error.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-207524318

I'm using Nancy 1.4.3 from Nuget according to my packages.

Hmm fair enough....

On Friday, 8 April 2016, Jamie [email protected] wrote:

I'm using Nancy 1.4.3 from Nuget according to my packages.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/tidusjar/PlexRequests.Net/issues/72#issuecomment-207531319

I can confirm the error @SaskiFX mentioned is also happening to me under mono, I think I narrowed it to your ConfigureConventions method @tidusjar

Any progress on this? This is what's keeping me from migrating.

@mescon I'm looking into the issue. We should have it resolved very soon.

@tidusjar Thanks a ton. :)

Can someone give this build a go?

https://ci.appveyor.com/project/tidusjar/requestplex/build/artifacts

Same thing with passing in the -base param.

Alright, ran it as this:

/usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base plexrequests 3579

It doesn't crash, and I do see it saying its loading the URL base.

root@debian:~# /usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base plexrequests 3579
Settings URL Base
Version: 1.6.0
Location of the database: /opt/PlexRequests/Release/PlexRequests.sqlite
Request Plex is running on the following: http://+:3579/

But I'm still getting redirected without the base URL.

root@debian:/opt/PlexRequests/Release/Views/Shared# curl -I https://<servername>/plexrequests
HTTP/1.1 303 See Other
Server: nginx/1.6.2
Date: Thu, 14 Apr 2016 01:58:21 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Location: /userlogin
Strict-Transport-Security: max-age=15768000

When I go and manually enter https://<servername>/plexrequests/userlogin I do get the page, but nothing else loads as before. (It looks like this: https://i.imgur.com/oPwS9wo.png )

In the source for the page I get:

<link rel="stylesheet" href="/assets/bootstrap.css" type="text/css"/>
    <link rel="stylesheet" href="/assets/custom.min.css" type="text/css" />
    <link rel="stylesheet" href="/assets/font-awesome.css" type="text/css"/>
    <link rel="stylesheet" href="/assets/pace.min.css" type="text/css"/>


    <!-- Scripts -->
    <script src="/assets/jquery-2.2.1.min.js"></script>
    <script src="/assets/handlebars.min.js"></script>
    <script src="/assets/bootstrap.min.js"></script>
    <script src="/assets/bootstrap-notify.min.js"></script>
    <script src="/assets/site.js"></script>
    <script src="/assets/pace.min.js"></script>
    <script src="/assets/jquery.mixitup.js"></script>
    <script src="/assets/moment.min.js"></script>

I tried to get it to load a .css file like before (visiting http://192.168.1.27/plexrequests/Content/pace.min.css) but that fails, and so does changing Content to assets like the source page.

Looking in the PlexRequests folder, I don't see an assets folder anywhere, but Content is still there.

Ok i'm on to something, I think I figured it out. The assets is now a virtual directory that points to /Content/ by default, but if you provide a -base it will change to /baseProvided/Content/

I have now fixed this with the latest dev build. Setup my own Ngnix reverse proxy to test and it all works correctly.

If you want to confirm you can here: https://ci.appveyor.com/project/tidusjar/requestplex/build/1.6.254/artifacts

(Note: if you are using an existing database you will need to go into the settings and change the Base Url, if you dont have a database yet (clean install) you can just pass in the -base param)

Woo! I'll remote in to my home system in a bit and give this a test and will update. :)

If this works will you push to master?

@mescon Correct. With a few other bug fixes.

Nice - looking forward to it! :)

I see the Base URL! But its not the one I expected. :)

root@debian:/opt/PlexRequests/Release# /usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base plexrequests 3579
Using a Base URL plexrequests
Version: 1.6.0
Location of the database: /opt/PlexRequests/Release/PlexRequests.sqlite
Request Plex is running on the following: http://+:3579/

But when I hit the site, I get a 404 from the server because it seems to be using 'test' instead of 'plexrequests' for the URL.

root@debian:/etc/nginx/sites-enabled# curl -I https://<servername>/plexrequests
HTTP/1.1 303 See Other
Server: nginx/1.6.2
Date: Thu, 14 Apr 2016 15:49:36 GMT
Content-Type: text/html
Content-Length: 0
Connection: keep-alive
Location: /test/userlogin
Strict-Transport-Security: max-age=15768000

I went and deleted the database to see if it was stuck, but it seems to still reading test from somewhere.

OOPS! I left some of my test code there!

I wondered if that's what it was. Happy to report that I did go in and change all mine back to using test and it did work!

Great! Just removed the test code (It was a dev build :smile: ) . Sorry about the long wait, I couldn't get my head around Ngnix until I set it up for myself!

Doh! Spoke too soon. I was getting redirected to /test/userlogin and it worked, but when I logged in it forwarded me back to /search, which 404ed.

But if I went and added /test/ back, the search loaded and loaded correctly.

Hey, no apologies. You are fixing code for us weirdos who want to reverse proxy stuff, and I for one greatly appreciate it. :+1:

OK must have been another area I missed. I will fully test the application before I push to master.

Once this all works, it should be working for both reverse http and reverse https as well, as I changed over to https a few days ago and things still seem to be working.

I used your link from before and clicked latest version on AppVeyor and downloaded the new zip it generated, just to see if I could get it back on /plexrequests/ instead of /test/. Running that version gave a huge error. Just an FYI.

root@debian:/opt/PlexRequests/Release# /usr/bin/mono /opt/PlexRequests/Release/PlexRequests.exe -base plexrequests 3579
Using a Base URL plexrequests
Version: 1.6.0
Location of the database: /opt/PlexRequests/Release/PlexRequests.sqlite
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Something went wron                                                                           g when trying to satisfy one of the dependencies during composition, make sure that you've registered all new dependencies in the container and inspect the innerexception for more details. ---> Na                                                                           ncy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.NancyEngine ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRequestDispatcher --->                                                                            Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRouteResolver ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.RouteCach                                                                           e ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: PlexRequests.UI.Modules.BaseModule ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: PlexRequests.Core                                                                           .ISettingsService`1[[PlexRequests.Core.SettingModels.PlexRequestSettings, PlexRequests.Core, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null]]
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x00787> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.Resolve (System.Type resolveType) <0x40fc3810 + 0x00057> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.Resolve[ResolveType] () <0x40fc37b0 + 0x00027> in <filename unknown>:0
  at PlexRequests.UI.Helpers.ServiceLocator.Resolve[T] () <0x40fe9b40 + 0x0004b> in <filename unknown>:0
  at PlexRequests.UI.Modules.BaseModule..ctor () <0x40fe9980 + 0x0003f> in <filename unknown>:0
  at (wrapper dynamic-method) System.Object:lambda_method (System.Runtime.CompilerServices.Closure,object[])
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x00432> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x004af> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) <                                                                           0x40fb49b0 + 0x00043> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc                                                                           .ResolveOptions options) <0x40fb4860 + 0x0008f> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x000b8> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x004af> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) <                                                                           0x40fb49b0 + 0x00043> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc                                                                           .ResolveOptions options) <0x40fb4860 + 0x0008f> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x000b8> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x0037b> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) <                                                                           0x40fb49b0 + 0x00043> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc                                                                           .ResolveOptions options) <0x40fb4860 + 0x0008f> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x000b8> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x0037b> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) <                                                                           0x40fb49b0 + 0x00043> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc                                                                           .ResolveOptions options) <0x40fb4860 + 0x0008f> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x000b8> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads p                                                                           arameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb4a10 + 0x0037b> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) <                                                                           0x40fb49b0 + 0x00043> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc                                                                           .ResolveOptions options) <0x40fb4860 + 0x0008f> in <filename unknown>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) <0x40fb400                                                                           0 + 0x000b8> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].SafeGetNancyEngineInstance () <0x40fe7f50 + 0x0008f> in <filename unknown>:0
  at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].GetEngine () <0x40fe7e40 + 0x00027> in <filename unknown>:0
  at Nancy.Owin.NancyMiddleware.UseNancy (Nancy.Owin.NancyOptions options) <0x40f6f0e0 + 0x00106> in <filename unknown>:0
  at Owin.AppBuilderExtensions.UseNancy (IAppBuilder builder, Nancy.Owin.NancyOptions options) <0x40f68050 + 0x00053> in <filename unknown>:0
  at PlexRequests.UI.Startup.Configuration (IAppBuilder app) <0x40f67ee0 + 0x0001f> in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f68                                                                           835ab960 + 0x000ef> in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7f68833e3ec0 + 0x0002a> in <filename unknown>:0
  at Owin.Loader.DefaultLoader+<>c__DisplayClass12.<MakeDelegate>b__b (IAppBuilder builder) <0x40f67e60 + 0x00076> in <filename unknown>:0
  at Owin.Loader.DefaultLoader+<>c__DisplayClass1.<LoadImplementation>b__0 (IAppBuilder builder) <0x40f67d30 + 0x000e6> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp (Microsoft.Owin.Hosting.Engine.StartContext context) <0x40f61110 + 0x00230> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin.Hosting.Engine.StartContext context) <0x40f54000 + 0x00147> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x40f530b0 + 0x0005c> in <filename unknown>:0
  at Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions options) <0x40f51bd0 + 0x0007b> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.StartImplementation (IServiceProvider services, Microsoft.Owin.Hosting.StartOptions options) <0x40f515a0 + 0x0005e> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions options) <0x40f502a0 + 0x00027> in <filename unknown>:0
  at Microsoft.Owin.Hosting.WebApp.Start[TStartup] (Microsoft.Owin.Hosting.StartOptions options) <0x40f501b0 + 0x00047> in <filename unknown>:0
  at PlexRequests.UI.Program.Main (System.String[] args) <0x40dd5650 + 0x00377> in <filename unknown>:0

Yeah I know about that issue, I'm fixing it now :)

There we go @SaskiFX the latest dev build should work

@SaskiFX Actually scrap that. Still have some more work to do.

No worries. :+1: I'll test again when you are ready. Gonna head to lunch over here.

Status:

  • [X] Admin sidebar
  • [X] Plex Request Settings
  • [X] Authenticate settings
  • [x] Plex Settings
  • [X] CP Settings
  • [x] Sonarr Settings
  • [x] Sickrage settings
  • [X] Logs
  • [x] Status
  • [x] Search
  • [x] Requests
  • [x] Admin Login
  • [x] Change password
  • [x] User login
  • [x] JS Script redirecting

I'll be looking forward to testing this as BaseUrl build as well. :)

First off, thank you so much for all the work you've put into this project. I foresee that PR.Net is going to push my family's media experience (shared across multiple state lines) into the next level.

That said, I installed 1.6.266 and have done a little testing . . .
I run a reverse proxy through Apache for all the usual apps; Sab, Sonarr, PlexPy, etc. With Apache redirecting port 80 to 443.
So, my Apache default-ssl.conf has the following lines:

<Location /test>
   order allow,deny
   allow from all
   ProxyPass http://192.168.1.11:3579/test
   ProxyPassReverse http://192.168.1.11:3579/test
</Location>

And I ran

$ sudo /usr/bin/mono /opt/test/Release/PlexRequests.exe -base test
Using a Base URL test
Version: 1.6.0
Location of the database: /opt/test/Release/PlexRequests.sqlite
Request Plex is running on the following: http://+:3579/

Navigating to https://hostname/test/ With a fresh PlexRequests.sqlite:
If I press Admin: 404 at hostname/login, changing the URL to hostname/test/login works
Registering for Admin is the same, changing the URL allows me to make a username, but hitting submit launches me to https://hostname/ (contents of /var/www/html)
Navigating back to https://hostname/test/admin I am successfully at the admin panel, where I am able to connect my Plex account and Sonarr install (CP does not connect, likely an unrelated issue, CP gives me a lot of problems here and elsewhere; same with Headphones which I don't use but have installed)
404 with both Search and Requests, editing in the /test base again gets me to the right page, but search isn't yielding any results. No surprises, I see the work on those areas isn't complete.

So, this effectively confirms the work you've specified in the checkboxes above. I really look forward to having the working base URL so I can tell some family and friends about it.
Again, thank you so much, this is going to eliminate a big chunk of emails and texts full of requests.

@achoerle348 Thanks! Guess what guys! It's finished!!! I'll be releasing 1.6.1 today :)

Fixed in release 1.6.1

Found a missing BaseURL spot. Admin registration link for when you are creating a new account. I started with a fresh database.

Damn! I thought I covered all areas.

Eh, its a lot of links to check. :) I was able to get registered and get in. Everything else seems to be working along with all my various sonarr, couchpotato, and pushover stuff.

Excellent, glad to hear!

_eagerly waiting_ :-)

@mescon 1.6.1 has been released :) Check the releases page. There is 1 place where the URL base doesn't work and that's when creating a admin

... which I would probably like to do :) I'll wait for your next push.

@mescon You can only create 1 administrator currently. So if you are using an existing database you will never go to that page.

I don't have an existing database, I'm still on the lokenx version!

When you click the link to make the admin account it will 404. Just add the base url in the address bar and it loads. Create the account and then you are good. Reload the site and your in. Everything else works as expected.

Sent from my iPhone

On Apr 16, 2016, at 1:19 PM, mescon [email protected] wrote:

I don't have an existing database, I'm still on the lokenx version!

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Ah cool, will try - thx!

Thank you so much @tidusjar for bearing with us on this and getting it resolved. Shout out to @SaskiFX and @mescon for helping troubleshoot and provide input.

I think he still has one link to fix. :)

Correct. I'll leave this open. But I'm not going to push a release out just for that one link :)

I'm having trouble getting this to work.

I install plexrequest and go to localhost:3579 and create an Admin account. I then create a URL base called 'request'. I hit save and then the css disappears. I then restart plexrequest.

I have tried localhost:3579 and it gives me 404 page not found. I then try domain/request and I also get 404 page not found. My apache settings are:


ProxyPass http://localhost:3579
ProxyPassReverse http://localhost:3579

Does http://localhost:3579/request work?

yes thank you that worked. I changed my reverse proxy settings to:


ProxyPass http://localhost:3579/request
ProxyPassReverse http://localhost:3579/request

All fixed.

:clap:

Im using the base url "requests" and it seems to work, except when i click on Admin i get the following error.

Error Details

Nancy.RequestExecutionException: Oh noes! ---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: `System.Dynamic.ExpandoObject' does not contain a definition for `SearchForMovies'
  at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object)
  at RazorOutput.RazorView.Execute () <0x41f90fc0 + 0x00251> in :0 
  at Nancy.ViewEngines.Razor.NancyRazorViewBase`1[TModel].ExecuteView (System.String body, IDictionary`2 sectionContents) <0x41f742e0 + 0x00110> in :0 
  at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
  at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2] (System.Runtime.CompilerServices.CallSite site, System.Dynamic.T0 arg0, System.Dynamic.T1 arg1, System.Dynamic.T2 arg2) <0x41f72e00 + 0x001ad> in :0 
  at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
  at Nancy.ViewEngines.Razor.RazorViewEngine+<>c__DisplayClass2b.b__2a (System.IO.Stream stream) <0x41f33a50 + 0x002d3> in :0 
  at Nancy.Responses.MaterialisingResponse.PreExecute (Nancy.NancyContext context) <0x41f338d0 + 0x0006b> in :0 
  --- End of inner exception stack trace ---
  at Nancy.NancyEngine.InvokeOnErrorHook (Nancy.NancyContext context, Nancy.ErrorPipeline pipeline, System.Exception ex) <0x41f95870 + 0x0027f> in :0

At this point i am not able to access the admin page to remove the base url. Im using a docker but cant check the version of the app.

Edit: saw in the release notes that you can't use base url "requests". Wiped the db and used "request" instead, all good now.

Maybe there should be a check for reserved URLs? :stuck_out_tongue:

That's true @khellang!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diedrichg picture diedrichg  Â·  4Comments

ThePaulMichaels picture ThePaulMichaels  Â·  4Comments

arm3n picture arm3n  Â·  3Comments

theg1nger picture theg1nger  Â·  3Comments

Thurman86 picture Thurman86  Â·  5Comments