jekyll-admin
                                
                                 jekyll-admin copied to clipboard
                                
                                    jekyll-admin copied to clipboard
                            
                            
                            
                        Jekyll url is not applied to the View button
Description:
Pressing the View button in the admin panel the URL is pointing to http://localhost:4000. But I'm behind a reverse proxy called Nginx.
Tell us a bit about yourself:
- Version of JekyllAdmin I'm using: 0.10.2
- Version of Jekyll I'm using: 4.1.1
- Version of NodeJS I'm using: v14.15.0
- Operating System <e.g. OS X, Windows>: Linux!
- Browser <e.g, Safari, Chrome>: Firefox!
Steps to reproduce:
- Setup Jekyll as normal
- Configure _config.ymlfile, and seturlkey to:url: "https://yourdomain.com"(baseurlis just "/")
- Configure Nginx to use yourdomain.comas server_name in Nginx with alocation /section containing at least:proxy_pass http://localhost:4000;
- Go to admin panel: https://yourdomain.com/admin
- Press the View button
- Links goes to http://localhost:4000/jekyll/update/2020/11/19/welcome-to-jekyll.html, which will NOT work.
I expected the following:
I expect the View links to take the url settings into account. The link example above, should go to:
https://yourdomain.nl/jekyll/update/2020/11/19/welcome-to-jekyll.html
But got the following, instead:
http://localhost:4000/jekyll/update/2020/11/19/welcome-to-jekyll.html
I think it shouldn't be that hard to get this solved, I hope 👍🏽 ?
Regards, Melroy van den Berg
this has been brought up a few times I believe, and I have yet to see an official response. I was able to get this working on my personal fork, however I do not believe my method (hijacking the URLable library to look for a special Jekyll config param) is necessarily a good answer for this project.
you can see my personal hack at this commit:
lib/jekyll-admin/urlable.rb
    def scheme
      JekyllAdmin.site.config["static_scheme"] || "http"
    end
    def host
      JekyllAdmin.site.config["static_host"] || JekyllAdmin.site.config["host"].sub("127.0.0.1", "localhost")
    end
    def port
      JekyllAdmin.site.config["static_port"] || JekyllAdmin.site.config["port"]
    end
... then on my Jekyll install:
_config.yml
static_scheme: https
static_host: [my domain name]
static_port: "443"
this got things working for me 👍
Wow, indeed this should become a PR. This is indeed working as expected.
For backwards compatibility change:
JekyllAdmin.site.config["static_scheme"] || "http"
To:
JekyllAdmin.site.config["static_scheme"] || JekyllAdmin.site.config["scheme"] || "http"
Thank you so much! Let's fix this once and forever people!
Ps. Also in YML this is just fine: static_port: 443 (no additional quotes are needed)
@i-a-n Thanks for the suggested solution. @ashmaroli Would you approve this?
Would you approve this?
I would approve a tested Pull Request that proposes use of JekyllAdmin.site.config["jekyll_admin"][key] instead.
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
I hope you get a reply so it can be merged.
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.
I would approve a tested Pull Request that proposes use of
JekyllAdmin.site.config["jekyll_admin"][key]instead.
Can you clarify this? I'm running jekyll-admin behind a reverse-proxy and would love to get this in there. I think you are suggesting we have a setting that... if present will override the jekyll host config? Seems reasonable to me.
It's a two year old issue. But as stated in my first issue description the website url is not being when indeed behind a reverse proxy (nginx). Causing those links not to work since they are pointing to local host with custom port. Instead of the domain name.
No, i get your issue @danger89... :) I would like this feature as well. My question for clarification was for @ashmaroli, as in what will it take to merge this pull request.
Ow sorry my bad!
@ashmaroli Your turn xD