Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I correct the Meteor base-url in a NginX reverse-proxy configuration?

I have installed both Apache and Meteor behind NginX through reverse-proxy (on an Ubuntu server). Apache is mapped directly as baseURL (www.mydomain.com/) and Meteor is mapped as a subfolder (www.mydomain.com/live/).

The problem I encounter is that my Meteor test (which works as expected at port 3000) stops working behind NginX since every single references (CSS, Javascript, template) are absolute to baseURL.

<html>
<head>
  <link rel="stylesheet" href="/live.css?abc">
  <script type="text/javascript" src="/packages/underscore/underscore.js?efg"></script>
  ...
  <script type="text/javascript" src="/template.live.js?hij"></script>
  <script type="text/javascript" src="/live.js?klm"></script>
</head>

Obviously, since Apache is mapped at baseURL, these files are not found when testing through NginX.

What would be the best way to resolve to problem? System Administration is not my forte, and Meteor is my first incursion at server-side javascript. So I don't even know if this can be fixed, and if so, if it's done through a server configuration, Meteor configuration or programmatically.


EDIT: The new "absolute-url" package in Meteor 0.4.0 fixed the problem!

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

like image 292
kinologik Avatar asked Jun 07 '12 16:06

kinologik


1 Answers

The new "absolute-url" package in Meteor 0.4.0 fixed the problem.

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

like image 178
kinologik Avatar answered Sep 21 '22 16:09

kinologik