Welcome! Log In Create A New Profile

Advanced

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

February 01, 2020 04:44AM
This is the "view source" of the html page:


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="favicon.ico">
<title>testproject</title>
<link href="js/app.js" rel="preload" as="script"><link href="js/chunk-vendors.js" rel="preload" as="script"></head>
<body>
<noscript>
<strong>We're sorry but testproject doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="text/javascript" src="js/chunk-vendors.js"></script><script type="text/javascript" src="js/app.js">
</script></body>
</html>


This is the result of the "localhost" word search in app.js:

https://drive.google.com/open?id=11QpJKjd4PLKNMnO7m2utCJ9PrzO8Oyji :

/***/ }),

/***/ 1:
/*!********************************************************************************************************************************************************************!*\
!*** multi (webpack)-dev-server/client?http://localhost (webpack)/hot/dev-server.js (webpack)-dev-server/client?http://192.168.1.7:8080/sockjs-node ./src/main.js ***!
\********************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(/*! /home/marco/vueMatters/testproject/node_modules/webpack-dev-server/client
/index.js?http://localhost */"./node_modules/webpack-dev-server/client/index.js?http://localhost");
__webpack_require__(/*! /home/marco/vueMatters/testproject/node_modules/webpack/hot/dev-server.js
*/"./node_modules/webpack/hot/dev-server.js");
__webpack_require__(/*! /home/marco/vueMatters/testproject/node_modules/webpack-dev-server/client
/index.js?http://192.168.1.7:8080/sockjs-node */"./node_modules/webpack-dev-server/client/index.js?http:
//192.168.1.7:8080/sockjs-node");
module.exports = __webpack_require__(/*! ./src/main.js */"./src/main.js");


/***/ })

/******/ });


These are the results of the "localhost" word search in chunk-vendors.js :

- https://drive.google.com/open?id=13EPYKgb7Vv4DHOTxD0jxYk_CbDDrJkMy
- https://drive.google.com/open?id=1UjWDsPyT-87GF4WJhVr-UhzOFGiBW8tH
- https://drive.google.com/open?id=1eq5pWm51sjCYQkIaQn5GZ6uEmrmS36Od
- https://drive.google.com/open?id=19QzxljB37HH5cvJ0jffdyX97u9hlBDsV


In this GitHub repository you can find all the related files: https://github.com/marcoippolito/testproject

the sudo nano /etc/nginx/conf.d/default.conf is the following:

server {
listen 443 ssl http2 default_server;
server_name ggc.world;

ssl_certificate /etc/ssl/certs/chained.pem;
ssl_certificate_key /etc/ssl/private/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-
draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:50m;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
#ssl_stapling on;
#ssl_stapling_verify on;

access_log /var/log/nginx/ggcworld-access.log combined;

add_header Strict-Transport-Security "max-age=31536000";
location = /favicon.ico { access_log off; log_not_found off; }
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

server {
listen 80 default_server;
listen [::]:80 default_server;
error_page 497 https://$host:$server_port$request_uri;
server_name www.ggc.world;
return 301 https://$server_name$request_uri;

access_log /var/log/nginx/ggcworld-access.log combined;

add_header Strict-Transport-Security "max-age=31536000";
location = /favicon.ico { access_log off; log_not_found off; }
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

# https://www.nginx.com/blog/nginx-nodejs-websockets-socketio/
# https://gist.github.com/uorat/10b15a32f3ffa3f240662b9b0fefe706
# http://nginx.org/en/docs/stream/ngx_stream_core_module.html

upstream websocket {
ip_hash;
server localhost:3000;
}

server {
listen 81;
server_name ggc.world www.ggc.world;

#location / {
location ~ ^/(websocket|websocket\/socket-io) {
proxy_pass http://127.0.0.1:4201;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwared-For $remote_addr;
proxy_set_header Host $host;

proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
}

}
# https://stackoverflow.com/questions/40516288/webpack-dev-server-with-nginx-proxy-pass
Subject Author Posted

net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 29, 2020 08:20AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 29, 2020 08:39AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly January 29, 2020 03:16PM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 30, 2020 08:11AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Anoop Alias January 30, 2020 08:28AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 30, 2020 10:01AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly January 30, 2020 01:46PM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 30, 2020 11:08AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 31, 2020 04:40AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly January 31, 2020 06:10AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 31, 2020 09:05AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 31, 2020 09:21AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly January 31, 2020 09:52AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI January 31, 2020 10:49AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly January 31, 2020 03:08PM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI February 01, 2020 04:44AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly February 02, 2020 06:08AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI February 11, 2020 02:28PM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI February 11, 2020 02:31PM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly February 12, 2020 03:14AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI February 12, 2020 04:24AM

Re: net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

MarcoI April 30, 2020 02:19PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 63
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready