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

136
Views
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 answers
Answer question

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 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!