My app URL is something like this:
http://my-domain.com/my-app/
My controller is working and it's configured like this:
framework.route('/my-app/', view_home);
My homepage.html is also working. The tag @{js('my-script.min.js')} outputs:
<script src="/my-app/js/my-script.min.js" type="text/javascript"></script>
I have a config-debug file with this content:
static-url : /my-app/
static-url-js : /my-app/js/
The problem: my server gives me 404 when I try to GET http://my-domain.com/my-app/js/my-script.min.js
I need to GET my JS files under http://my-domain.com/my-app/js
I don't know why, but I can GET this way: http://localhost:8000/js/my-script.min.js
I don't know if this is a totaljs config issue, or some kind of nginx config issue.
Could anybody help me, please?
I didn't know two totaljs apps cannot share the same domain. That's exactly what I want to do. It's not a big deal, because I can change it to http://my-app.my-domain.com/
It's not perfect, but it's fine.
Thanks!
Thanks
server {
listen 80;
server_name my-domain.com;
charset utf-8;
# my personal homepage (totaljs too)
location / {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# my awesome app (that's the relevant part)
location /my-app/ {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}