I developed a small
nodejs application and I’m facing a weird issue.
Essentially, I’m using
ExpressJS and I configured the static files, such as (js, css, etc…) to that path:
when I run the application on windows I have no problem, all the css and js file are loaded correctly, eg:
<!-- STYLE CSS --> <link rel="stylesheet" href="/css/bootstrap.min.css"> <link rel="stylesheet" href="/css/style.css"> <link rel="stylesheet" href="/css/custom-style.css">
but when I run the app on
ubuntu I get the 404 error.
The structure of the app is:
app.js config environment.js public css js
environment.js load the folder
Perhaps the problem is in my Apache Proxy:
<VirtualHost *:80> ServerAdmin [email protected] ServerName mydomain.com ServerAlias *.mydomain.com DocumentRoot /var/www/html/mysite.com ProxyPass /calc/ http://localhost:4568/ ProxyPassReverse /calc/ http://localhost:4568
infact I entered with
VNC and if I type: localhost:4568 works, the problem happen when I use mydomain.com/calc, the app loading but the statics file not..
AFAIK the DocumentRoot is supposed to be set to the top-level directory containing your static files, i.e. the
public directory. So it should be closer to:
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.