How to control where Meteor runs

后端 未结 4 1605
离开以前
离开以前 2021-02-01 09:21

I\'m installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor on that directory giv

4条回答
  •  遥遥无期
    2021-02-01 10:07

    The way that Meteor sets the ROOT URL is by using an environment variable called ROOT_URL:

    http://docs.meteor.com/#meteor_absoluteurl

    So you could run your Meteor instance like so: ROOT_URL="http://mydomain.com/" meteor --port 80

    However, if you want to have the meteor instance served from a folder (like http://mydomain.com/meteortest), you will have to use nginx to forward ports (see Tyr's example) but replace the line:

    location / {
    

    with:

    location /meteortest {
    

    and change your ROOT_URL appropriately. If you still can't access your domain from outside, you may have not set your security groups properly for EC2. You have to open up port 80. More information on how to do this can be here: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html

提交回复
热议问题