Netgate SG-1000 microFirewall

Author Topic: nginx - I don`t understand //SOLVED\\  (Read 2280 times)

0 Members and 1 Guest are viewing this topic.

Offline Kalle13

  • Jr. Member
  • **
  • Posts: 42
  • Karma: +5/-1
    • View Profile
nginx - I don`t understand //SOLVED\\
« on: August 24, 2016, 05:17:20 pm »
Hi,

I want to get wpad support on my pfsense (2.3.2) and I am following this manual https://nguvu.org/pfsense/pfSense-2.3-WPAD-PAC-proxy-configuration-guide/
At the point where I have to test the second nginx instance I get this output

Code: [Select]
[2.3.2-RELEASE][admin@pfSense.localdomain]/root: /usr/local/sbin/nginx -c /usr/local/etc/nginx/nginx-wpad.conf
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] still could not bind()


After a little research:

Code: [Select]
[2.3.2-RELEASE][admin@pfSense.localdomain]/root: sockstat -l | grep :80
root     nginx      89102 8  tcp4   *:80                  *:*
root     nginx      89102 9  tcp6   *:80                  *:*
root     nginx      88826 8  tcp4   *:80                  *:*
root     nginx      88826 9  tcp6   *:80                  *:*
root     nginx      88033 8  tcp4   *:80                  *:*
root     nginx      88033 9  tcp6   *:80                  *:*

Code: [Select]
[2.3.2-RELEASE][admin@pfSense.localdomain]/root: sockstat -l | grep nginx
root     nginx      89102 6  tcp4   *:443                 *:*
root     nginx      89102 7  tcp6   *:443                 *:*
root     nginx      89102 8  tcp4   *:80                  *:*
root     nginx      89102 9  tcp6   *:80                  *:*
root     nginx      89102 10 stream /var/run/php-fpm.socket
root     nginx      88826 6  tcp4   *:443                 *:*
root     nginx      88826 7  tcp6   *:443                 *:*
root     nginx      88826 8  tcp4   *:80                  *:*
root     nginx      88826 9  tcp6   *:80                  *:*
root     nginx      88826 10 stream /var/run/php-fpm.socket
root     nginx      88033 6  tcp4   *:443                 *:*
root     nginx      88033 7  tcp6   *:443                 *:*
root     nginx      88033 8  tcp4   *:80                  *:*
root     nginx      88033 9  tcp6   *:80                  *:*
root     nginx      88033 10 stream /var/run/php-fpm.socket


Why is nginx listening on port 80?
The option for the web GUI is checked on https  ???
I don`t understand this.
Can anyone give me a hint, please.

Thank you and best regards.
« Last Edit: August 25, 2016, 05:59:21 pm by Kalle13 »
"Jeder kocht mit Wasser, man kann das Binsenweisheit nenn`. Der unterschied zu dir ist, dass wir zwei kochen könn`"

- Kinderzimmer Productions

Offline dennypage

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +143/-0
    • View Profile
Re: nginx - I don`t understand
« Reply #1 on: August 24, 2016, 06:39:18 pm »
It listens on 80 to offer a redirect to 443. System / Advanced / Admin Access / WebGUI Redirect.

Offline Kalle13

  • Jr. Member
  • **
  • Posts: 42
  • Karma: +5/-1
    • View Profile
Re: nginx - I don`t understand
« Reply #2 on: August 25, 2016, 05:57:40 pm »
Thank you, that worked for me!  ;D

Best regards.
"Jeder kocht mit Wasser, man kann das Binsenweisheit nenn`. Der unterschied zu dir ist, dass wir zwei kochen könn`"

- Kinderzimmer Productions

Offline fifouch

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #3 on: September 19, 2016, 08:18:49 am »
hey i do follow same guide for setup wpad on pfsense 2.3.2 and got same error i did disable the webconfigurator redirect and i'm usings https with costume port still same error
« Last Edit: September 19, 2016, 08:34:06 am by fifouch »

Offline Kalle13

  • Jr. Member
  • **
  • Posts: 42
  • Karma: +5/-1
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #4 on: September 19, 2016, 01:31:37 pm »
Hi,

what does
Code: [Select]
sockstat -l | grep :80 say?

Best regards
"Jeder kocht mit Wasser, man kann das Binsenweisheit nenn`. Der unterschied zu dir ist, dass wir zwei kochen könn`"

- Kinderzimmer Productions

Offline christianit

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #5 on: February 06, 2018, 10:16:22 pm »
hi ... i also got the same error and have followed the instructions explained before, but still experience the same thing.

The following output results after execution of the code: sockstat -l | grep: 80

Code: [Select]
[2.4.2-RELEASE][admin@pfSense.mylocal]/root: sockstat -l | grep :80             
www      nginx      97632 7  tcp4   *:80                  *:*
root     nginx      97523 7  tcp4   *:80                  *:*

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 2435
  • Karma: +192/-9
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #6 on: February 07, 2018, 03:48:22 am »
Just a question :
....
Code: [Select]
www      nginx      97632 7  tcp4   *:80                  *:*
"www" ??
First time I see nginx running on pfSEnse with such an identity.
For me it's "root" everywhere.

Offline christianit

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #7 on: February 07, 2018, 04:23:03 am »
I do not know why the "www" identity can appear other than "root".

and one question

is it correct for the "nginx" folder located in / usr / local / www relating to the nginx-dist folder in the same location? because in the case I experienced like that and does it affect?

thanks.

Code: [Select]
[2.4.2-RELEASE][admin@pfSense.mylocal]/usr/local/www: ls -l
lrwxr-xr-x   1 root  wheel      25 Oct 23 05:36 nginx -> /usr/local/www/nginx-dist

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 2435
  • Karma: +192/-9
    • View Profile
Re: nginx - I don`t understand //SOLVED\\
« Reply #8 on: February 07, 2018, 05:15:45 am »

Code: [Select]
[2.4.2-RELEASE][admin@pfSense.mylocal]/usr/local/www: ls -l
lrwxr-xr-x   1 root  wheel      25 Oct 23 05:36 nginx -> /usr/local/www/nginx-dist
This isn't 'normal' at all.
Or, actually, it's simple. You think you have a pfSense device, but you don't. It's something else.
Re install completely - and I even advice you not to use the backup of the config.