Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
¿No puede imprimir la IP de una solicitud en un servidor expressjs detrás de nginx?

Probé la siguiente solución:

 app.enable('trust proxy'); ... console.log(req.ip); // gives ::ffff:127.0.0.1 console.log(req.ips); // gives [] console.log(req.header('x-forwarded-for')); // gives undefined console.log(req.connection.remoteAddress); // gives ::ffff:127.0.0.1

¿Hay alguna otra manera?

¿Es esto un síntoma de un problema mayor?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Si desea utilizar el encabezado X-Forwarded-For, primero debe configurarlo con nginx:

 proxy_set_header X-Forwarded-For $remote_addr;

Ver los documentos:

  • http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!