Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Content Not Getting Proxy Base #28

Closed
Cimplex opened this issue Jan 31, 2020 · 4 comments
Closed

Static Content Not Getting Proxy Base #28

Cimplex opened this issue Jan 31, 2020 · 4 comments

Comments

@Cimplex
Copy link

Cimplex commented Jan 31, 2020

Here is my start command:
/usr/bin/python3 /opt/Kitana/kitana.py --prefix /kitana --behind-proxy True --proxy-base https://plexbox.us

Here is my nginx config:

    location ^~ /kitana/pms_asset {
        expires 1M;
        access_log off;
        add_header Cache-Control "public";
        proxy_pass http://127.0.0.1:31337;
        #include proxy.conf;
        add_header Transport 'dynamic';
    }

    location ^~ /kitana/static/  {
        root /opt/;

        # versioned static rewrite
        rewrite "^(\/kitana\/static\/(css|js|img)\/)(\w+)\.\w{7}\.(\w{2,4})$" $1$3.$4 last;
    }

    location /kitana/ {
        proxy_pass http://127.0.0.1:31337;
        add_header Transport 'dynamic';
        #include proxy.conf;
    }

When you look at the source, it doesn't look like Kitana is acknowledging the proxy=true setting. It works on the local machine (because the machine is hosting the server), but obviously it doesn't work remotely. Notice the static content is trying to come from 127.0.0.1.

kitana-no-static-content

I'm probably doing something stupid. It has to be something wrong with the start command?

@Cimplex
Copy link
Author

Cimplex commented Jan 31, 2020

One other thing, I didn't realize that the rewrite was case sensitive on linux. To simplify my setup, I have a symbolic link to the lowercase kitana.

So my /opt/ looks like:

lrwxrwxrwx  1 root root    6 Jan 31 23:39 kitana -> Kitana
drwxr-xr-x 10 plex plex 4096 Jan 31 23:10 Kitana

Now it actually can serve static content, as seen by the fav icons (the first picture wasn't serving them), but it still is acting like it doesn't know about my proxy base, but only on the css and js file.

kitana-no-static-content-2

@pannal
Copy link
Owner

pannal commented Feb 1, 2020

Can you try uncommenting proxy.conf in your NGINX? It seems like the headers aren't passed properly.

Should not be the case and would be a bug but might well fix this in the meantime.

@pannal pannal closed this as completed in 1dcdc74 Feb 2, 2020
@pannal
Copy link
Owner

pannal commented Feb 2, 2020

Your issue should be fixed with 0.3.1-3

@Cimplex
Copy link
Author

Cimplex commented Feb 7, 2020

Thank you so much for the quick fix. I wasn't able to test until now. All is working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants