0

nginx reverse proxy issues

exile259 4 years ago 0

I recently had to rebuild my server, and have since ran into an issue running Ubooquity behind my reverse proxy. It's (currently) the only service I'm having trouble running.  If I log in via IP:port, everything works fine. If I attempt to go in via the proxy, cover art refuses to load and it takes quite a while to error out.  Errors show as :

20200819 18:35:46 [qtp1421866327-147] ERROR com.ubooquity.d.b - Request processing failed for URI: /ubooquity/books/1903/coverFolder?cover=true (method:GET)

or

<!--StartFragment-->20200819 18:26:45 [qtp1421866327-126] INFO  com.ubooquity.d.c - Cookie token invalid or too old. Access Denied. [login:####][ip:172.18.0.2]
20200819 18:26:45 [qtp1421866327-88] INFO  com.ubooquity.d.c - Cookie token invalid or too old. Access Denied. [login:####][ip:172.18.0.2]
20200819 18:26:45 [qtp1421866327-114] INFO  com.ubooquity.d.c - Cookie token invalid or too old. Access Denied. [login:####][ip:172.18.0.2]
20200819 18:26:45 [qtp1421866327-117] INFO  com.ubooquity.d.c - Cookie token invalid or too old. Access Denied. [login:####][ip:172.18.0.2]
20200819 18:26:45 [qtp1421866327-70] INFO  com.ubooquity.d.c - Cookie token invalid or too old. Access Denied. [login:####][ip:172.18.0.2]<!--EndFragment-->

I've tried both as a subdomain and a subfolder. Subfolder vhost conf is


# set the reverse proxy prefix in the admin gui to ubooquity.

    location ^~ /ubooquity {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;

    # enable for Authelia, also enable authelia-server.conf in the default site config
    #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2202;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

    location ^~ /ubooquity/admin {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2203;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

Subdomain looks like:

# Make sure that your dns has a cname set for ubooquity and that your ubooquity container is not using a base url

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name book.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    # enable for Authelia
    #include /config/nginx/authelia-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /ldaplogin;

        # enable for Authelia
        #include /config/nginx/authelia-location.conf;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2202;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

    location /admin {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2203;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

    location /admin-res {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2203;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

    location /admin-api {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app ubooquity;
        set $upstream_port 2203;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

I can curl that URL from inside the docker container just fine, so it's not communication across the bridge, but something with the reverse proxy itself. Any ideas/help is greatly appreciated.