Mupx HTTPS 502 Bad gateway


#1

I have recently installed the reaction commerce framework on my ec2 server. I am able to connect to the site using the ip and http://mysite.com but not with https - I get the 502 error. I have tested the cert and its good it does the mupx setup no problems and deploys no problems but I cant connect to it via https. Please help, Im not as good at devops as Id like to be. Thanks.


#2

Have you configured your mup.json with your cert information?


#3

Yes, it goes through the setup and deploy perfectly.
Im even getting the green lock.


#4

Do you have traffic on 443 enabled in your security group on ec2?


#5

Yes, Im at my wits end. All my other projects on ec2 work fine.


#6

Are you using https://atmospherejs.com/meteor/force-ssl?


#7

I just tried that and it forced me to the https which doesnt work. I wasnt able to get to the site by ip like before so I removed it.


#8

Well my next step would be to remove the ssl stuff from the mupx deployment and just handle the ssl at the nginx level?


#9

Ill have to look into how to do that, not too familiar with it. >.<


#10

I cant even find the dang nginx conf file…I tried to look in the docker containers folders but its giving me permission denied. I looked in all the places it says to online and there is no nginx folder…please help.


#11

Well, by default, mupx is going to try to serve your app at port 80. What you will need to do is to install nginx on your server, run your mupx deployment on another port, and use a reverse proxy in your nginx config. Then, you can set your ssl up at the nginx level. Does that make sense?


#12

Not really, Ive never really dug into nginx too much. Ill look some stuff up and see what I can figure out. Thanks!


#13

Hey man I am getting that error in a site I switched over from modulus to aws ec2 so now this issue is much more urgent. Is there any way you can give me a lil hand in understanding this situation a little bit better?
Like for instance when I search if nginx is running - it says it is, but I can find the folder anywhere to even look at the config file. Any help is appreciated.


#14

If you are running ubuntu, your nginx conf is likely in /etc/nginx/sites-available/.

Also, this tutorial is a bit dated and doesn’t use mup, but the conf file looks good to me.

Pay attention to the following lines:

// These are the paths to your cert files
ssl_certificate /etc/nginx/ssl/todos.pem; # full path to SSL certificate and CA certificate concatenated together
ssl_certificate_key /etc/nginx/ssl/todos.key; # full path to SSL key

// You will need to change 8080 to whatever port you set up in your mupx deployment
proxy_pass http://127.0.0.1:8080;

// And of course you will need to use your server name anywhere you see:
server_name todos.net;