pfSense Forum

pfSense English Support => General Questions => Topic started by: Kalle13 on August 24, 2016, 05:17:20 pm

Title: nginx - I don`t understand //SOLVED\\
Post by: Kalle13 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/ (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.
Title: Re: nginx - I don`t understand
Post by: dennypage on August 24, 2016, 06:39:18 pm
It listens on 80 to offer a redirect to 443. System / Advanced / Admin Access / WebGUI Redirect.
Title: Re: nginx - I don`t understand
Post by: Kalle13 on August 25, 2016, 05:57:40 pm
Thank you, that worked for me!  ;D

Best regards.
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: fifouch 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
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: Kalle13 on September 19, 2016, 01:31:37 pm
Hi,

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

Best regards
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: christianit 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                  *:*
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: Gertjan 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.
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: christianit 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
Title: Re: nginx - I don`t understand //SOLVED\\
Post by: Gertjan 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.