configure shiny server with nginx

2020-02-15 r nginx shiny

I am trying to configure nginx to redirect requests to a shiny server. before this configuration shiny server and all the apps work fine, but when I tried to use the following script in the nginx some functions of shiny is broken. here is my nginx config

   rewrite ^/shiny$ $scheme://$http_host/shiny/ permanent;

    location /shiny/ {
      rewrite ^/shiny/(.*)$ /$1 break;
      proxy_pass http://localhost:3838;
      proxy_redirect / $scheme://$http_host/shiny/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_read_timeout 20d;
      proxy_buffering off;

using above script all the requests to the url/shiny/ are redirected to the shiny server but I have faced two error. Then an error with with odbc driver appears, which means it can not find driver

Warning in odbcDriverConnect(st, believeNRows = F) :
  [RODBC] ERROR: state 01000, code 0, message [unixODBC][Driver Manager]Can't open lib '/usr/local/nz/lib/' : file not found
Warning in odbcDriverConnect(st, believeNRows = F) :

if I disable nginx everything works fine. I tried to set user parameter in nginx but did not work. Any idea how I can fix this issue?