Apache blocks websocket protocol for Shiny - r

I've deployed a web-app using Shinyproxy and Shiny.
If I go to http://localhost/mycontextpath/app/01_example everything works perfectly. The ProxyPass and ProxyPassReverse have been set up in Apache and now I can go directly to http://mywebsite.org/mycontextpath/app/01_example to use my app.
The problem is that the screen greys out automatically. I know it's a problem with Apache as the browser debugger print this message:
Firefox can't establish a connection to the server at ws://mywebsite.org/mycontextpath/wonderful_hypatia/websocket/.
I've tried to add this line to my Apache configuration:
ProxyPassMatch "^/(.+)/websocket" "ws://localhost:8146/mycontextpath/$1/websocket" keepalive=On
But it doesn't seems to work.
Any suggestion? Thank you!

If you have to stick to Apache as your proxy server, read this post Running Shiny Server with a Proxy.
Or if you are open to using Nginx, Shinyproxy website actually has the detailed Nginx configuration on its website under the HTTPS (SSL / TLS) section. That's also the configuration I'm using and it works just fine.

Related

How do I do a 301 redirect with Azure Wordpress running Nginx?

I need to redirect HTTP to HTTPS, and www to non-www, with the Azure AppService version of Wordpress. This version uses the wordpress-alpine-php docker image, running nginx version 1.20.2.
I think I need to add a server block to nginx.conf, but I am not sure which version of this file it's using. I see the file in these locations.
/etc/nginx/nginx.conf
/home/site/wwwroot/nginx.conf
I've tried both of them, but neither seems to work. The one under etc doesn't seem to persist a container reload. I do know about copying the correct version and then reloading nginx with a startup command, as described in this Microsoft article.
Is nginx.conf the place to do this?
Which versions of the file is this using at runtime?
Is there a better way to do this with the azure app service?

Not able to edit Public Server Name for embedded Tomcat

we are using Artifactory 6.20.0 in docker-compose mode. Stack is up and running fine. But I am not able to edit the "Public Server Name" in HTTP settings. It is greyed out.
How can I change it?
From Which file TomCat picks these values?
As per my understanding If I change Http settings and use nginx or tomcat. Still my Artifactory is reachable using same address which embedded Tomcat has provided and nginx will be only used for the path based routing. or nginx takes care of both parts?
Please note 'HTTP settings' in Artifactory UI is a template to generate the reverse proxy configuration according to provided fields and you can use the same snippet downloaded and install directly in the corresponding directory of your reverse proxy server.
Answers to your queries:
Embedded tomcat will not pickup any values from this template, it runs on 8081 (over http) by default.
As stated above, changing Http settings in UI will not help as it is a simple template. You must have a reverse proxy installed and place the required configuration on reverse proxy directories in order to access Artifactory over a DNS(http/https). Please refer to Configuring Reverse Proxy wiki page for more details.

code-server (docker) and nuxt.js / javascript 404

Setup: I use a self-hosted code-server (dockerized) behind a fritzBox on my home lan. I have a FQDN (mysub.mydomain.com) pointing to a dyndns (mysdyn.my-router.com) with a cname entry which ends up on the fritzBox, port forwarded to the docker machine via a nginx reverse proxy with letsencrypt enabeld.
code-server works fine and is available via mysub.mydomain.com. With the live-server plugin works great#code-server and can be reached via mysub.mydomain.com/proxy/3000/ (3000 is an example port). Hot-reload and Javascript works.
Problem: working on a nuxt.js project (universal), when I run "yarn dev" the dev-server comes up normaly and the page can be reached via mysub.mydomain.com/proxy/3000/ and displays correct. But the "hot-reload" as well as all java scripts are not working because of a 404 for all .js-files.
The browser is looking for all .js-files under e.g. https://mysub.mydomain.com/_nuxt/runtime.js which correctly causes the 404, because coorect location would be https://mysub.mydomain.com/proxy/3000/_nuxt/runtime.js
What is causing this behavior and how can I fix this? I am even not sure where to start. Nginx or Nuxt? I already tried to play around with the router-setting in the config.nuxt.js - no luck.
thanks for your help!
So, mysub.mydomain.com/proxy/3000/ is a hosted website behind an Nginx configuration?
If it's the case, you can't use yarn dev. This command is aimed towards a local development server.
You can't have HMR running on a hosted production app through some DNS, reverse proxy, port forwarding and so on. Or at least, this is what this is aimed towards.
Even having hot reload via code-server is kinda not mainstream. So yeah, you could maybe try some hacky things and achieve it, but you'll still end-up experiencing quite some bugs and the performance will probably be sub-par.
You don't want to stick to some local running apps?

localhost.run wordpress ssh tunneling

I need to show a preview of a wordpress project to a client. I want to setup a tunnel to expose the macOS apache server instance. In past I was using ngrok but with wordpress it requires some configuration and I don't want to waste time in plugins installation ecc.
I've tried with Serveo, but it seems to be offline at the moment, after a little bit of research I've found localhost.run that offer the same service of Serveo.
How I can find the actual port of the embed apache server of my macOS and how I will expose wordpress without plugins installation?
I've tried with this command
ssh -R 80:localhost:8080 ssh.localhost.run
but it will give an error when I open the tunneling url:
Something went wrong opening the port forward, check your SSH command output for clues!
Try setting the Apache "httpd.conf" to
Listen 8080 and
ServerName localhost:8080

Redirecting a meteor app from naked domain to www with https (ssl) on

I am trying to redirect my meteor app (hosted by heroku) to www with https on. So:
https://exampledomain.com -> https://www.exampledomain.com
Is there a way to do this either in Heroku or the Meteor application itself? Thank you.
Meteor by itself cannot do redirects and does not support https.
Heroku is a hosting service, and will host whatever compatible application you give it, on top of it's Cedar stack, which is basically an Ubuntu OS. It does not even know that your app will be using http. So the Heroku environment will not help you either.
What you need to do is build an Heroku app consisting of your Meteor app and a HTTP Reverse Proxy in front of it, which handles the redirect you are asking for, and also the https. This proxy terminates the https connections coming from the Internet, and serves them as http to your Meteor app behind it.
The easiest proxy to set up is Nginx, although HAProxy also works well.
Have a look at for example Have you managed to make your node nginx proxy setup on Heroku work? for how to set this up.

Resources