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.

View button links to 0.0.0.0

See original GitHub issue

Description:

I am binding Jekyll to 0.0.0.0 using the -H 0.0.0.0 parameter to jekyll serve in order to make it possible to access Jekyll both on the loopback interface and other configured interfaces (so I could access Jekyll on the local LAN). While Jekyll-Admin seems to work well, the View button attached to every page does links to http://0.0.0.0:4000/my-page instead of /my-page.

Tell us a bit about yourself:

  • Version of JekyllAdmin I’m using: 0.8.0
  • Version of Jekyll I’m using: 3.7.3
  • Operating System: Centos on the server, Fedora on client
  • Browser: Mozilla Firefox

Steps to reproduce:

jekyll new test
cd test
jekyll serve --watch --incremental --livereload -H 0.0.0.0
  • Open web browser FROM ANOTHER COMPUTER on the computer public IP, edit a page, then click on the View button.

I expected the following:

Browser should open http://[public ip]:4000/my-page, page content should be displayed.

But got the following, instead:

Browser opens http://0.0.0.0:4000/my-page, which is inaccessible.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:13

github_iconTop GitHub Comments

8reactions
SmallhillCZcommented, Sep 6, 2019

I would vote to reopen this issue. You are missing reverse proxy and Docker situation.

The case to reproduce is:

  • I have a server with some IP, serving multiple apps to multiple hostnames, including http://example.com where I want a Jekyll site
  • On the server jekyll is listening to host 0.0.0.0 and port 4000
  • Nginx or Docker takes care of proxying the internet requests to http://example.com to the local server instance on 0.0.0.0:4000
  • When I click the View button, http://0.0.0.0:4000/... is opened instead of http://example.com/... resulting in 404

Using Nginx without Docker, the local instance would probably run on localhost:4000 instead of 0.0.0.0:4000, however it is the same situation.

2reactions
tomercommented, Jul 30, 2018

https://github.com/jekyll/jekyll-admin/blob/0c5e7fa515d8a674e6996fedcc2cd5062fcc7784/lib/jekyll-admin/urlable.rb#L60 I changed that line to use a custom config value I added in _config.yml and it updated the link values to the host I wanted.

Some browsers (such as Firefox) treats 0.0.0.0 the same as 127.0.0.1, so there is no problem accessing such address. On the other hand, if Jekyll requested to listen to INADDR_ANY, the user may be interested to access the server from remote machine, so redirecting to 127.0.0.1 is pointless.

What I would suggest is a simple replace code to replace 0.0.0.0 (or 127.0.0.1) with the content of the HTTP request Host header – If the browser could access the server using that address, that’s an address the browser could use for the following requests. Another option could be to replace the absolute URLs with relative URLs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to communicate with a device that has an assigned “0.0 ...
Normally you'll see systems and applications bind ports to 0.0.0.0 which means the port is accessible from any interface.
Read more >
What IP java use when provide 0.0.0.0 as localAddress in ...
I don't believe 0.0.0.0 is a valid local address for a connected socket, but if it is INADDR_ANY , which means 'use any...
Read more >
Why would one of my devices address be 0.0.0.0?
It literally means "This Network" so it represents the entire network. Your device is trying to connect to the network, and can see...
Read more >
No virtual IP address for Hamachi just 0.0.0.0.
On the top to the right of the power button it has no IP address just 0.0.0.0. Any ideas on how to fix...
Read more >
How to allow Login to any IP address? - Salesforce Developers
Go to Adinistration Setup >> Profile >> selecte the desired profiles >> Go to Login IP ranges related list >> click on new...
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