question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get protocol in server-side rendering

See original GitHub issue

Hi All!

My question is i need to get origin dynamically, I try req.headers and I got:

image

Yes!, I got host, but I also need the protocol, which needs to concat with host to create new api path. I browsed All req properties but I got nothing. Have any good idea? thx a lot!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
timneutkenscommented, Jul 5, 2017

It’s safe to assume it’s always http and the SSL termination has to be done by a reverse proxy like Nginx. These set the X-Forwarded-Proto header which you could use.

1reaction
quentin-sommercommented, Jul 5, 2017

Well that’s my bad!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server-side rendering - Apollo GraphQL Docs
Server -side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw...
Read more >
Nextjs - Cannot get url prarams(query) on server side rendering
So im trying to get req query aka GET params from the url into server side rendering for basicly validation and / login...
Read more >
What is server-side rendering and how does it improve site ...
Server -side rendering ensures that website content appears quickly, without first having to download and run application code.
Read more >
Headless Chrome: an answer to server-side rendering JS sites
const {html, ttRenderMs} = await ssr(`${req.protocol}://${req.get('host') ...
Read more >
Next.js Framework and the Server-Side Rendering method
In 2014 Google announced that it will rank only the sites sending data via the HTTPS protocol. To this end, the website needs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found