0
Under review

Hardcoded /comics subdirectory

Offspring 6 years ago updated 6 years ago 10

I run my Ubooquity install under /comics, and Ubooquity is hardcoded to include /comics in the URL path so it shows up as domain/comics/comics. Is there anyway to strip the hardcoding and just simply use the reverse proxy that the user has, and if they don't have the reverse proxy then use the subpath? That's how most other apps work and it works out well.


This also negatively impacts me as when it's in /comics/comics you can't actually access any of the comics, it just keeps reloading back to the main page for either Comics or Latest Comics.

Under review

I guess I'm going to need an explanation with a few examples, I'm not sure I understand what you mean.

So basically, I run Ubooquity behind an NGINX proxy. You go to domain.net/comics and it brings you to Ubooquity. I set my reverse proxy prefix to comics. When I'm looking at the Latest Additions, I see this: domain.net/comics/comics/?latest=true. If I'm looking at the Publishers page, I see: domain.net/comics/comics/347876/.


This is all under 1.0. If I move to 2.0, I literally cannot use the service because instead of the root page being / and tacking my /comics on, it becomes /comics/comics/ and keeps refreshing the page. You should be able to repro by simply changing your reverse proxy prefix to comics and then loading the page.

Could you give me your nginx config (the part that for the reverse proxy) ?


Top portion (uncommented) is the old version since the Comixology theme still works with it. The commented out section is the new version, where the same issue occurs:


                        location /comics {
                        proxy_pass http://192.168.1.176:2202;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Real-IP $remote_addr;
        }
#       location /comics {
#                       proxy_pass http://192.168.1.176:2202;
#                        proxy_set_header Host $host;
#                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#                        proxy_set_header X-Real-IP $remote_addr;
#        }
#        location /comics/admin {
#                        proxy_pass http://192.168.1.176:2203;
#                        proxy_set_header Host $host;
#                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#                        proxy_set_header X-Real-IP $remote_addr;
#        }


+1

I may have missed something, but I can't reproduce the issue.


Here is what I tested:


Full nginx config file:

worker_processes  1;
events {
    worker_connections  1024;
} http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    
    server {
        listen       80;         location /comics {
            proxy_pass http://10.0.0.3:2202;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Real-IP $remote_addr;
        }        
        
        location /comics/admin {
            proxy_pass http://10.0.0.3:2203;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
}
Reverse proxy prefix config:


Direct access to Ubooquity:



Access through Nginx:


-1

The unable to view the comics might be due to the Comixology theme, but the other issue, which is what the title is about, is clearly visible in your screenshots in the URL: it says comics/comics and not just /comics.

I don't see the problem here... The /comics/comics/ is because you put the ubooquity root in your own /comics-path and then you go to the comics folder from that root. Of course then it will read /comics/comics/. If you would instead go to books from the same root it would read /comics/books/. Nothing wrong there. The issue would be that you can't open your comics, an issue I guess Tom does not have.

+1

I focused on the second issue (the page loading one), which is apparently not caused by Ubooquity itself.


As for the hardcoding of the "comics" and "books" section, I still don't see how I could have these two different sections without them having different paths.


I understand that, but the starter of the topic seem to focus more on the /comics/comics/ "problem"

Why not let the user choose what to use? For example, I don't use the books section at all so if I could disable that, and thus strip the /comics portion out that would be perfect. All I really want is to not have /comics/comics though.