OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • NGINX Error on Setup
« previous next »
  • Print
Pages: [1]

Author Topic: NGINX Error on Setup  (Read 5130 times)

thewolf56

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
    • View Profile
NGINX Error on Setup
« on: July 14, 2021, 05:26:23 am »
Hello,

I tried searching for a solution before posting, but I have been unable to solve my issue of setting up NGINX with Let's Encrypt on my OPNsense firewall.

I followed this tutorial (https://forum.opnsense.org/index.php?topic=19305.0), but when I finally went to start, I received the following errors in the NGINX logs

2021/07/13   16:33:54   emerg   78826#100183   bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/07/13   16:33:54   emerg   78826#100183   bind() to [::]:80 failed (48: Address already in use)
2021/07/13   16:33:54   emerg   78826#100183   still could not bind()
2021/07/13   16:34:10   emerg   99740#100114   bind() to unix:/var/run/nginx_status.sock failed (48: Address already in use)

I did a search and although I have been using https with port 440 for my GUI, I ran sockstat and found port 80 was being used by lighttpd.  Did more searching, disabled the GUI http redirect, and NGINX still would not start.

Reran sockstat and no port 80 is listed after changing the redirect setting.  Restarted the machine and no port 80 found using sockstat, but NGINX still shows the errors above with multiple bind() :80 failed messages.

Any advice would be appreciate.

Thanks
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: NGINX Error on Setup
« Reply #1 on: July 14, 2021, 10:06:44 pm »
sockstat -4 | grep 80 is really empty? Usually its only the redirect rule
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: NGINX Error on Setup
« Reply #2 on: July 14, 2021, 11:35:39 pm »
Another reason could be that you define stream servers and http servers in nginx using port 80. Then nginx blocks itself.
Logged

thewolf56

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
    • View Profile
Re: NGINX Error on Setup
« Reply #3 on: July 15, 2021, 02:30:17 am »
Quote from: mimugmail on July 14, 2021, 10:06:44 pm
sockstat -4 | grep 80 is really empty? Usually its only the redirect rule

It's not empty per se, but it is getting three hits that are not port 80.  One because of VLAN 180 address and two because the ports have the number 80 as part of the digits

Code: [Select]
root@OPNsense:~ # sockstat -4 | grep 80
root     ntpd       3210  31 udp4   192.168.180.1:123     *:*
root     lighttpd   58302 4  tcp4   127.0.0.1:43580       *:*
root     nc         31856 3  tcp4   127.0.0.1:8080        *:*
Logged

thewolf56

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
    • View Profile
Re: NGINX Error on Setup
« Reply #4 on: July 15, 2021, 02:31:02 am »
Quote from: fabian on July 14, 2021, 11:35:39 pm
Another reason could be that you define stream servers and http servers in nginx using port 80. Then nginx blocks itself.

I don't think I did that, but I will definitely go back and double-check.
Logged

thewolf56

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
    • View Profile
Re: NGINX Error on Setup
« Reply #5 on: July 15, 2021, 06:10:23 am »
Well, I double-checked that the stream and http servers were not sharing port 80 and that definitely was not the case as I did not have any stream servers setup (yet) in NGINX.

So, I uninstalled NGINX, updated opnsense (I'm not technically savvy enough to be on the cutting edge of fixing unknown bugs, so I usually wait a little bit for others to upgrade first), reinstalled NGINX and sure enough, it started up.

Now, I'm trying to get my Home Assistant and FreePBX VMs setup to be able to connect from the outside securely...
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: NGINX Error on Setup
« Reply #6 on: July 15, 2021, 06:26:21 am »
Now we will never know ...  8)
But it seems it was just a small problem somewhere ..
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

thewolf56

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
    • View Profile
Re: NGINX Error on Setup
« Reply #7 on: July 15, 2021, 07:01:34 am »
Quote from: mimugmail on July 15, 2021, 06:26:21 am
Now we will never know ...  8)
But it seems it was just a small problem somewhere ..

It was the weirdest thing, but glad I can at least get it started now.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • NGINX Error on Setup
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2