Reputation: 149
I deployed meteor app (bundle) on Amazon EC2 Ubuntu with nginx. I need to run my app on example.com/myapp. I used:
export ROOT_URL='http://example.com/myapp'
Part of my nginx:
server {
listen 80;
server_name: example.com;
location /myapp {
proxy_pass http://localhost:3000;
...
But I'm getting errors:
Exception in defer callback: Error: Oh no! No route found for path: "/myapp/"
and:
GET http://example.com/cfs/servertime 404 (Not Found)
GET http://example.com/font/myfont 404 (Not Found)
How to solve it?
Upvotes: 2
Views: 863
Reputation: 1640
Yes, in iron-router you can use a variable for the prefix path. See my usage here https://github.com/c316/give/blob/master/both/router/routes.js. Basically you just declare the variable in the data portion of the route and then use :variableName in the path.
Upvotes: 1
Reputation: 75945
The thing is with nginx, it can help you solve the server side routing bit of it, but the it can't help with the client side routing (since the browser computes this bit).
There's no alternative to it other than prefixing your client side routes to /myapp/
.
You can leave your server side routes as-is since nginx will route them for you.
Upvotes: 1