Answer the question
In order to leave comments, you need to log in
How to set up nodejs (express) socket.io nginx and have it all on localhost???
Colleagues, good day. Who set up such a stack on the localhost??????
The browser gives an error: GET prototype.localhost/socket.io/socket.io.js net::ERR_ABORTED 404 (Not Found).
in template:
config nginx:<script src="/socket.io/socket.io.js"></script>
server {
listen 80;
listen (:):80;
server_name prototype.localhost;
root /home/marey/projects/prototype.map;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/marey/projects/default;
}
location / {
proxy_pass http://prototype.localhost:5000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
include config/general.conf;
}
location ~* \.(jpg|jpeg|gif|png|ico|css|js|zip|rar|pdf)$ {
expires off;
}
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
Answer the question
In order to leave comments, you need to log in
download the finished assembly
on the git in bulk
, you can directly with the front part
, search by keyword for example MEVN (mongo express vue node)
run node server.js in the console
and I don’t see the port in the error, so the server is not enabled
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question