Ho controllato il file “error.log” su /var/log/nginx
2023/10/27 00:24:07 [error] 1008693#1008693: *2744 connect() failed (111: Unknown error) while connecting to upstream, client: 198.235.24.31, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 01:22:17 [error] 1008693#1008693: *2756 connect() failed (111: Unknown error) while connecting to upstream, client: 35.161.8.2, server: api.ghisellinimoreno.it, request: "GET / >
2023/10/27 01:26:18 [error] 1008693#1008693: *2759 connect() failed (111: Unknown error) while connecting to upstream, client: 167.248.133.39, server: api.ghisellinimoreno.it, request: "GE>
2023/10/27 01:26:19 [error] 1008693#1008693: *2761 connect() failed (111: Unknown error) while connecting to upstream, client: 167.248.133.39, server: api.ghisellinimoreno.it, request: "GE>
2023/10/27 02:05:47 [error] 1008693#1008693: *2769 connect() failed (111: Unknown error) while connecting to upstream, client: 13.58.59.50, server: api.ghisellinimoreno.it, request: "GET />
2023/10/27 02:25:37 [alert] 1008693#1008693: *2779 write() to "/var/log/nginx/access.log" was incomplete: 29 of 212 while logging request, client: 151.71.172.31, server: bandieragialla.ghi>
2023/10/27 02:25:38 [error] 1008693#1008693: *2780 connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: "OPT>
2023/10/27 02:25:38 [error] 1008694#1008694: *2782 connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: "OPT>
2023/10/27 02:25:38 [alert] 1008694#1008694: *2782 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 151.71.172.31, server: api.ghi>
2023/10/27 02:25:38 [error] 1008694#1008694: *2781 connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 02:25:38 [error] 1008694#1008694: *2784 connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: "OPT>
2023/10/27 02:25:38 [error] 1008693#1008693: *2785 connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 02:27:15 [alert] 1008693#1008693: *2791 write() to "/var/log/ngin2023/10/27 06:28:04 [error] 2259737#2259737: *144 connect() failed (111: Unknown error) while connecting to upst>
2023/10/27 07:05:31 [error] 2259737#2259737: *158 connect() failed (111: Unknown error) while connecting to upstream, client: 192.155.90.220, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 07:14:21 [alert] 2259737#2259737: *165 write() to "/var/log/nginx/access.log" was incomplete: 351 of 456 while logging request, client: 18.220.179.206, server: bandieragialla.gh>
2023/10/27 07:17:41 [alert] 2259737#2259737: *167 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 185.254.196.186, server: bandie>
2023/10/27 07:18:38 [crit] 2259737#2259737: *178 SSL_do_handshake() failed (SSL: error:0A00006C:SSL routines::bad key share) while SSL handshaking, client: 104.152.52.196, server: 0.0.0.0:>
2023/10/27 07:22:46 [alert] 2259737#2259737: *180 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 83.97.73.87, server: bandieragi>
2023/10/27 07:42:03 [alert] 2259737#2259737: *182 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 34.76.96.55, server: bandieragi>
2023/10/27 07:44:54 [alert] 2259737#2259737: *185 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 199.45.155.34, server: bandiera>
2023/10/27 07:48:32 [alert] 2259737#2259737: *188 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 64.62.197.184, server: bandiera>
2023/10/27 07:50:24 [alert] 2259737#2259737: *190 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 64.62.197.187, server: bandiera>
2023/10/27 07:56:32 [alert] 2259737#2259737: *195 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 18.220.179.206, server: api.ghi>
2023/10/27 07:56:33 [error] 2259737#2259737: *196 connect() failed (111: Unknown error) while connecting to upstream, client: 18.220.179.206, server: api.ghisellinimoreno.it, request: "POS>
2023/10/27 07:56:35 [error] 2259737#2259737: *199 connect() failed (111: Unknown error) while connecting to upstream, client: 18.220.179.206, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 07:56:36 [error] 2259737#2259737: *202 connect() failed (111: Unknown error) while connecting to upstream, client: 18.220.179.206, server: api.ghisellinimoreno.it, request: "GET>
2023/10/27 07:56:38 [error] 2259737#2259737: *205 connect() failed (111: Unknown error) while connecting to upstream, client: 18.220.179.206, server: api.ghisellinimoreno.it, request: "GET>
2023/10/
viene evidenziato un errore di connessione "connect() failed (111: Unknown error) while connecting to upstream, client: 151.71.172.31, server: api.ghisellinimoreno.it, request: “GET>”
nel file db.js effettuo la connessione a Mysql come da codice allegato
const config = require("./config.json");
const mysql = require('mysql2');
// originale per sviluppo su localhost
const Sequelize = require('sequelize')
const sequelize = new Sequelize(
config.database,
config.user,
config.password,
{
host: config.host,
dialect: config.dialect,
operatorsAliases: 0,
pool: {
max: config.pool.max,
min: config.pool.min,
acquire: config.pool.acquire,
idle: config.pool.idle
}
}
);
let db;
// connettere Mysql utilizzato con create connection
db.connect(err=> {
if(err) {
console.log(err,'errore in connessione Mysql');
}else {
console.log('Mysql connected con successo');
}
})
// creo connessione a mysql con pool
let pool;
pool = mysql.createPool({
connectionLimit: 300,
host: config.host,
user: config.user,
password: config.password,
database:config.database,
port:config.port
});
db.Sequelize = Sequelize;
db.sequelize = sequelize;
// model di tutte le tabelle utilizzate
db.user = require("./models/user.js")(sequelize, Sequelize);
db.socio = require("./models/socio.js")(sequelize, Sequelize);
// ----- altre tabelle
module.exports = db;
effettuata la connessione a mysql visualizzo con dei console.log l'esito sia positivo che negativo della connessione.
Chiedo se sapete indicarmi dove, in ambiente AWS, vengono scritti questi messaggi di console.log per capire se la connessione è avvenuta con successo o se si sono verificati errori che hanno impedito la corretta connessione
Questo per capire se gli errori CORS visualizzati in analisi della Web Application possono derivare da un errore di mancata connessione.
Grazie
Moreno