0

Good afternoon, on my nginx server, on the internal network I can access the standard nginx page, but externally not! I did a tcpdump and the packages are coming to the server. I tried to disable the Ubuntu firewall sudo ufw disable and also nothing. Does anyone know which configuration is missing? I Have 2 network adapters! One for internal network (apache servers) and another for external network

Config file:

upstream immcloud {
    server 10.1.1.3;
    server 10.1.1.4;
}

server {
    listen 80;
    listen [::]:80;
    server_name _;

    more_set_headers 'Server: IMM GUARD';

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    location / {
        proxy_set_header Accept-Encoding "";
        proxy_pass "http://immcloud/";
        sub_filter </body>
        "<script>console.log('%c oi', 'color: red; font-size: 30px;');</script></body>";
        sub_filter_once on;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}
8
  • Without knowing what you have in your configuration files, it's hard to say. You should post your sites-enabled/default contents here - also running commands such as lsof -Pi:80 might reveal if it's binding to the wrong interface card. Naturally, your ISP/Provider might just be blocking the external port in the first place.
    – Miuku
    Dec 24, 2019 at 17:16
  • Ok, the code that is not from the default page but is also happening the same, I just put in the question. My ISP is not blocking the port because I already tested it with apache on another virtual machine to the outside and it worked. lsof -Pi: 80 command returns this (external interface is ens33): i.ibb.co/3vf1y1V/image.png
    – tomas
    Dec 24, 2019 at 17:21
  • Do you use DMZ? Port forwarding or anything that might be pointing to the wrong IP or port? Since nginx is listening to * I would wager the issue lies elsewhere, perhaps even in the systems own firewall. iptables --list -n might be revealing too. Can you nmap/portscan your system from the outside?
    – Miuku
    Dec 24, 2019 at 17:42
  • No, I correctly pointed the ip 192.168.1.42 which locally works! Router Configuration: i.ibb.co/ftDk7s5/image.png
    – tomas
    Dec 24, 2019 at 17:50
  • I was doing some testing, and I created another machine with nginx, but only with a network adapter and it worked! In other words, he is probably answering the wrong card, does anyone know how to correct this?
    – tomas
    Dec 24, 2019 at 18:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.