Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda