E
E
Egor Mikheev2016-11-28 19:14:54
Nginx
Egor Mikheev, 2016-11-28 19:14:54

Why does the web server (node.js + nginx) return undeclared content when requesting a page?

I came across a very strange situation in which, in the process of requesting a page, the server, among other things, returns a bunch of garbage (various requests to third-party services), which greatly slows down page loading.

var http = require('http');

http.createServer(function(req,res){

    var path = req.url.replace(/\/?(?:\?.*)?$/, '').toLowerCase();
    switch (path) {
        case '':
            res.writeHead(200, { 'Content-Type': 'text/plain' });
            res.end('Homepage');
            break;
        case '/about':
            res.writeHead(200, { 'Content-Type': 'text/plain' });
            res.end('О нас');
                    break;
        default:
            res.writeHead(404, {'Content-Type': 'text/plain'});
            res.end('Не найдено');
    }
}).listen(8181);

As a result, here:
939dd5a40aaa415ba3fe804c3467c5e3.png
I don’t even know where to dig in this case.
Available at: lessions.nebesa.me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Mikheev, 2016-11-28
@ogregor

It turned out that this is pulled up by mozilla plugins

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question