Adding local web-server to meteor-up's proxy


I originally posted this question in meteor-up’s github (Using MUP proxy along side local web-server · Issue #1343 · zodern/meteor-up · GitHub), but maby someone here has any suggestions.

My senario is that I have deployed an app with meteor-up on a DigitalOcean droplet and this is working perfectly fine with SSL through LetsEncrypt.

I have recently integrated Typesense to my app as a search engine and the typesense server is installed and running on the same droplet on port 8108 and I have issued a sertificate to this service manually with certbot. This actually works fine as I am specifying the portnumber in my https request to typesense from my app.

The problem however is that I am experiencing that the network filter on my workplace is blocking all requests to the typesense server and I’m guessing this has to do with it not running on port 443.

What I am hoping to achieve is to have the nginx proxy from meteor-up also handle requests to the same way as it does for my meteor app. Alternatively having a seperate nginx running outside of meteor-up and handle both cases, but I don’t have the knowledge for that as of now and I’m really enjoing the eas of use that meteor-up provides.

Any suggestions appreciated.

Hi, sorry to answer with a different solution that you are looking for but instead of setting up multiple services and coordinating them yourself it would be better to use a service that allows you to deploy any docker image.

And yes, I’m talking about my own service but you could also use other options in the market.

But at we have a lot of experience with Meteor apps and we also support any docker image so you could install anything that you want and everything will be done automatically for you.

What do you think?

Feel free to schedule a free tech call here Calendly - Filipe Névola

Thanks for the response.

I am willing to look into other means to accomplish this, but this is a small internal tool hence why it’s all currently running on a single droplet and I feel that it should be possible to have the nginx-service handle the requests for this as well.

I will keep trying to figure it out, but will definitely have you in mind if I decide to go for an alternative hosting solution.

it is entirely possible to do this. You can run multiple Meteor instances on the same droplet, and mup uses the reverse proxy (NGINX) to route requests to the correct docker instance.

There is a list of plugins for mup here Meteor Up - Plugins

The documentation is light on, but this stuff does work.

The capabilities you need are a part of nginx. What mup does for you is manipulate the nginx config files for you to make it easy.

If you ssh into your droplet, and do a docker ps you will see the reverse proxy docker image

39c1a890ccaa   zodern/nginx-proxy:v1.1.0                        "/app/docker-entrypo…"   2 days ago      Up 2 days>80/tcp, :::80->80/tcp,>443/tcp, :::443->443/tcp   mup-nginx-proxy

You can shell into it with this command

docker exec  -it 39c1a890ccaa bash
cd /etc/nginx/vhost.d
ls -la

And you will see a file for each virtual server that you have.

There is also a file /etc/nginx/conf.d/default.conf which has an entry for each vhost

You could manually edit these files, but you are probably better to experiment with using the other mup plugins to achieve what you want.

There is another proxy tool called Caddy which is super-easy to set up, and you might want to look into that.

All this will take you time, and you might ultimately be better taking @filipenevola advice and using a service. It’s up to you.

1 Like

Thank you for the detailed answer. It helped me alot.

I ended up installing nginx on the server instead of relying on mup to handle the reverse proxy. I reused the config generated by mup and added the typesense server to it.

If I had the knowledge I would create a plug-in for mup that enables adding servers to the reverse proxy by simply supplying the internal ip/port and the url because it is really nice to have mup handle everything including ssl with one command. But for now this is working and the extra steps are manageable.

1 Like

Delete mup for ever and use nginx it’s so much better. Nginx is the way. Mup is totally pointless and a time waster, a wrapper for literally 3 commands.

ok … there seem to be more than 3 commands. I need to admit, without wanting to censor you :slight_smile: that some of your messages might use some “For me …”

mup deploy Deploy app to server
mup init Setup files for new mup project
mup logs Show app’s logs. Supports options from docker logs
mup reconfig Updates server env and start script to match config
mup restart Restart app
mup setup Install dependencies, custom certificates, and MongoDB on
mup ssh [server] SSH into server
mup start Start app
mup status View status of your app, databases and other components
mup stop Stop app
mup validate validate config
mup docker Setup and manage docker
mup meteor Deploy and manage meteor apps
mup mongo Commands to manage MongoDB
mup proxy Setup and manage reverse proxy and ssl
mup beanstalk Deploy Meteor app to AWS Elastic Beanstalk

It’s literally 4 commands to build and deploy you do the following:

  • Build your app: meteor build ../build --architecture os.linux.x86_64
  • Deploy it: scp ../build/app.tar.gz user@server:~/
    • (Optional Backup to instant rollback): sudo cp -R bundle bundle-backup/
  • Unpack it on server: tar -zxf app.tar.gz
  • cd into bundle directory and run install: (cd programs/server && npm install)
  • Run: node main.js (do this inside a screen and dettach ctrl+a d it so it runs in the background with screen and doesn’t close)

Why do you need mup at all? Its slow and pointless. Always has been. Just use your server like it was intended.