Thank you for your answer. I have configured the CORS headers on my reverse proxy (nginx) and it works well now.
Thank you!
Make sure IIS is forwarding the client's IP Address to NodeBB
@pitaj said in run nodebb on iis cause Error: ipaddr: the address has neither IPv6 nor IPv4:
IIS is forwarding
how?
I don't know. I've never used IIS.
this is my web.config file
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="/app.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="sendToNode">
<match url="/*" />
<action type="Rewrite" url="app.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
After line 68 in src/meta/blacklist.js
, can you add this?
console.log('blacklist testing:', clientIp);
Then start NodeBB again, and let me know what echoes before the stack trace.
i dont see anything in iis logs and in output.log in logs folder of nodebb
i wrote in ipaddr.js
in line 583
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format" + string);
iis logs print :
ipaddr: the address has neither IPv6 nor IPv4 format formatundefined
this is my request
POST /login HTTP/1.1
Host: mysite.com
Connection: keep-alive
Content-Length: 100
Origin: mysite.com
x-csrf-token: EyCm57iR-ckzZLbUtx4iv96r3OWR9x7bjVYw
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: /
X-Requested-With: XMLHttpRequest
Referer: http://mysite.com/login
Accept-Encoding: gzip, deflate
Accept-Language: he-IL,he;q=0.9,en-US;q=0.8,en;q=0.7
Cookie: express.sid=s%3Ax5vzU6uF36diteLyw9xg_DVbXgNl9LA_.MIY34QvMFdPH1k1w2x7i2ES%2B8vIQo%2ByAXqeok%2BhHrt4; io=a7s6sAdWXxSYNTprAAAB
i dont see the line: Accept-Encoding: gzip, deflate
when i run the site with node localhost
My mistake, please add that line before line 68.
@julian still nothing
Unfortunately I cannot help further as you are unable to provide a log that I need to see. Line 68 is the one calling ipaddr, and so placing the console.log
before it should echo properly.
result
blacklist testing: undefined
found solution
<iisnode enableXFF="true" />