Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Conditional SSR with Next.js

I'm building a website with Next.js hosted on Netlify and I want to restrict access to the staging environment and allow it on production by checking users ips against my ip whitelist.

To do that I need to use getServerSideProps where I get the IP from headers and compare it. On staging, I don't need this functionality and the same pages should not have this funtionality. It looks like getServerSideProps can't be run conditionally based on env variables, so I'm currently stuck with it.

Maybe someone had experience with same problem or can advice alternative approaches?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The solution to this issue was found within next.js itself. They released the plugin for Nettlify a couple of days ago, and now they support next js redirects. Essential Next.js plugin v4 release notes

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda