I'm a beginner programmer and I'm trying to run a node.js app in a "folder" (How do you call it?) of a static HTML site.
I can access my node.js app locally (from http://localhost:3919/), but when I try loading http://mysite.hu/tablafilc, I get this error: Cannot Get /
.
If I try loading some random page (like http://mysite.hu/asdfasf) however, I get a different error message: 404 not found
. This means something is working, but there is still an error somewhere in my code.
Is this actually impossible? Shoud I try running it from a subdomain intstead?
my /etc/nginx/sites-enabled/default file looks like this:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name www.mysite.hu mysite.hu;
location / {
try_files $uri $uri/ =404;
}
location /tablafilc {
proxy_pass http://localhost:3919;
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;
}
location ~ ^/(tablafilc|socket.io) {
proxy_pass http://localhost:3919;
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;
sub_filter /tablafilc /;
}
}
PS: My static site doesn't have a page called tablafilc. And of course mysite.hu is not my website.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…