Trying to get Shiny apps to load without using trailing slashes. Here is my sites-enabled
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name mschwarz.us;
location /shiny/ {
proxy_pass http://127.0.0.1:3838/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
rewrite ^(/shiny/[^/]+)$ $1/ permanent;
}
location /rstudio/ {
proxy_pass http://127.0.0.1:8787/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
What happens when I go to http://mschwarz.us/shiny/test-apps/hello is I am redirected to http://mschwarz.us/test-apps/hello/
Here are the last few lines in the shiny log:
^[[33m[2017-02-26 22:50:57.118] [WARN] shiny-server - ^[[39mNo host header sent by user-agent undefined
^[[31m[2017-02-27 07:18:07.658] [ERROR] shiny-server - ^[[39mFailed to render error 500 page: Can't set headers after they are sent.
Thanks!