I have installed both Apache and Meteor behind NginX through reverse-proxy (on an Ubuntu server). Apache is mapped directly as baseURL (www.mydomain/) and Meteor is mapped as a subfolder (www.mydomain/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!
I have installed both Apache and Meteor behind NginX through reverse-proxy (on an Ubuntu server). Apache is mapped directly as baseURL (www.mydomain./) and Meteor is mapped as a subfolder (www.mydomain./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./#absoluteurl
Share Improve this question edited Sep 5, 2012 at 15:16 kinologik asked Jun 7, 2012 at 16:48 kinologikkinologik 1112 silver badges8 bronze badges 2- As this is more a server-based problem you might your question a better fit at Pro Webmasters. – user577537 Commented Jun 8, 2012 at 12:21
- @adamjansch - I'll give it a try, but since the Meteor devs are using StackOverflow as a way to receive feedback and interact with developers, I figured it was (and still is) the best way to go at the moment. – kinologik Commented Jun 8, 2012 at 18:12
2 Answers
Reset to default 6The new "absolute-url" package in Meteor 0.4.0 fixed the problem.
http://docs.meteor./#absoluteurl
Why are you including scripts and styles in your <head>
with Meteor? Anything included within your meteor project directory, be it js, html or css, will get bundled up and served to the client without being included in your HTML with <link>
and <script>
.
If you must include things in your <head>
, why not just use the absolute path including the subfolder?
<html>
<head>
<link rel="stylesheet" href="/live/live.css?abc">
<script type="text/javascript" src="/live/packages/underscore/underscore.js?efg"></script>
...
<script type="text/javascript" src="/live/template.live.js?hij"></script>
<script type="text/javascript" src="/live/live.js?klm"></script>
</head>
Forgive me if I'm misunderstanding the problem.