1

I have a server, and 2 Express-based project running on port 3000 and 4000. Landing page has default template nginx html code, with Botkit iframe embed code. Port 3000 Express server is Botkit Starter Guide project, running with no modification. Port 4000 Express server is just Hello World project. Both server executed using pm2.

Below is my /etc/nginx/sites-enabled/default config:

server {
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    return 301 http://hwsrv-492795.hostwindsdns.com;
    location / {
        try_files $uri $uri/ =404;
    }
}

server {
    listen 80;
    listen [::]:80;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name hwsrv-492795.hostwindsdns.com;
    location / {
        try_files $uri $uri/ =404;
    }
    location /test01/ {
        proxy_pass http://142.11.241.150:3000/;
    }
    location /test02/ {
        proxy_pass http://142.11.241.150:4000/;
    }
}

So here is what I can't solve:

  1. Botkit Chatbot is successfully loaded on http://hwsrv-492795.hostwindsdns.com.
  2. While Botkit Chatbot behaves normally on http://142.11.241.150:3000/, it doesn't do so on http://hwsrv-492795.hostwindsdns.com/test01/. It just load /index.html, but failed (404) to load /css/styles.css, /embed.js, and /chat.html
  3. Hello world behaves just fine on both http://142.11.241.150:4000/ and http://hwsrv-492795.hostwindsdns.com/test02/.

I can curl those file from the server terminal, meaning that there is no problem on accessing those file. The question is, how do I enable or allow linked files and folder for sites that is generated using Express server to be readable on browser?

Hadi
  • 19
  • 3

0 Answers0