Welcome! Log In Create A New Profile

Advanced

Re: Nginx not responding to port 80 on public IP address

February 04, 2021 03:06AM
I insist on encryption so this is what I use:

server {
listen 80;
server_name yourdomain.com www.yourdomain.com ;
if ($request_method !~ ^(GET|HEAD)$ ) {
return 444;
}
return 301 https://$host$request_uri;
}

I only serve static pages so I use that filter. Obviously that is
optional. But basically every unencrypted request to 80 is mapped to an
encrypted request to 443.

On Thu, 4 Feb 2021 07:40:35 +0000
Adam <adam@monkeez.org> wrote:

> Hi all,
>
> nginx is running and listening on port 80:
> tcp 0 0 0.0.0.0:80 0.0.0.0:*
> LISTEN 0 42297 3576/nginx: master
> tcp6 0 0 :::80 :::*
> LISTEN 0 42298 3576/nginx: master
>
> The server responds fine to requests on port 443, serving traffic
> exactly as expected:
> tcp 0 0 0.0.0.0:443 0.0.0.0:*
> LISTEN 0 42299 3576/nginx: master
>
> However, it will not respond to traffic on port 80. I have included
> this line in my server block to listen to port 80:
> listen 80 default_server;
> listen [::]:80 default_server;
>
> My full config can be seen at https://pastebin.com/VzY4mJpt
>
> I have been testing by sshing to an external machine and trying telnet
> my.host.name 80 - which times out, compared to telnet my.host.name
> 443, which connects immediately.
>
> The port is open on my router to allow port 80 traffic. This machine
> is hosted on my home network, serving personal traffic (services
> which I use, but not for general internet use). It does respond to
> port 80 internally, if I use the internal ip address
> (http://192.168.178.43).
>
> I've kind of run out of ideas, so thought I would post here.
>
> Thanks in advance for any support.
>
> Adam

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx not responding to port 80 on public IP address

Adam February 04, 2021 02:42AM

Re: Nginx not responding to port 80 on public IP address

gariac February 04, 2021 03:06AM

Re: Nginx not responding to port 80 on public IP address

Francis Daly February 04, 2021 05:08AM

Re: Nginx not responding to port 80 on public IP address

Adam February 04, 2021 07:02AM

Re: Nginx not responding to port 80 on public IP address

Francis Daly February 04, 2021 07:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 81
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready