Use proxy pass and bookmark

Hello,

I want to use a a proxy for my app. The problem is that I use urls bookmark too, and I can’t add some urls to the proxy because even if it the only app the landing page is on the list of app.

Moreover I don’t want the app on the / page, but on the /padle/.

This is my shinyproxy configuration.

server:
  servlet:
    context-path: /padle

proxy:
  port: 8080
  authentication: none
  container-log-path: /var/log/shinyproxy/container-logs
  hide-navbar: true
  bind-address: 127.0.0.1
  landing-page: /

  docker:
    internal-networking: false
    cert.pem: /etc/apache2/ssl/padle_sophia_inrae_fr_cert.cer
    key.pem: /etc/apache2/ssl/padle.key.pass
    
        

  specs:
  - id: padle
    display-name: PADLE
    description: Profiling Anaysis of DifferentiaL Expression
    container-cmd: ["R", "-e", "options(golem.app.prod = T); padle::run_app()"]
    container-image: padle

# server:
#   forward-headers-strategy: native

logging:
  file:
    name: /var/log/shinyproxy/shinyproxy.log
  level:
    root: INFO

When I use landing page = /app/padle with the context path, I am landing on the page /app/padle and not /padle/app/padle, so there is an error. If I set landing page to /padle/app/padle, there is an error too.

This is my config nginx :

 location /padle/ {
        proxy_pass          http://127.0.0.1:8080;
        # proxy_redirect http://127.0.0.1:8080 http://127.0.0.1:8080/padle/app/padle/$1;


        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
        
        proxy_redirect    off;
        proxy_set_header  Host             $http_host;
        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;
    }

If I uncomment proxy redirect, the app doesn’t launch and redirect to the list of the app. I try to set the context-path to / but there is 404 error.

I try to use this, with context path set to / and /padle :

   location ~ ^/padle/(.*)$ {
           proxy_pass          http://127.0.0.1:8080/padle/app/padle/$1;
           # Or proxy_pass          http://127.0.0.1:8080/app/padle/$1;
           ...
    }

With nothing than error 404.
When I look in the error file for nginx, i see [error] 13686#13686: *292 connect() failed (111: Connection refused) while connecting to upstream this error message, for this configuration (http://127.0.0.1:8080/padle/app/padle/$1, context-path=/padle and landing-page=/)

I need help, please, also, but this a bonus, I want to have an clean url in the browser, so a thing like this /padle/values=… .

The version of shinyproxy I use is 2.5.0.

Thanks,
Regards,
Arthur

Hello,

I have a element of answer here, but I think it’s a bug or something.

When I use context-path: /padle, and proxy_pass http://127.0.0.1:8080/padle/, I have the ‘webjars’ (repertory with jquery and bootstrap) that load perfectly.

But when I try proxy_pass http://127.0.0.1:8080/padle/app/padle inside nginx config, there is just the html of the lauching app that is charged. The ‘webjars’ repertory became not found anymore.

I need help, please.
Arthur

Hello again,

My problem is finally solved, it just that I thought that app and app_direct are the same thing, but no it not. This is the final config:

nginx conf :

location /padle/ {
        proxy_pass          http://127.0.0.1:8080/padle/app_direct/padle/;


        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 600s;
        
        proxy_redirect    off;
        proxy_set_header  Host             $http_host;
        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;
    }

With context-path: /padle and landing-page: /for the application.yml.

It work,
Regards,
Arthur

1 Like

I’m happy to hear you managed to find a solution! Thanks for sharing it.