Postleaf / postleaf

Simple, beautiful publishing with Node.js.
https://www.postleaf.org/
MIT License
505 stars 204 forks source link

CSS link is an absolute URL breaking layout #75

Open windware-ono opened 6 years ago

windware-ono commented 6 years ago

Summary

If I run the instance on port 3000 and access it there without a reverse proxy, one of the CSS (/assets/css/lib.css) is linked as an absolute URL, which breaks the linking if the host name is not exactly specified including the port in .env for APP_URL. (ex : http://my.domain:3000/, instead of just http://my.domain/).

Steps to Reproduce

  1. Install as normal.
  2. node app
  3. Access directly without a reverse proxy http://my.domain:3000/

Additional info

claviska commented 6 years ago

This is a side effect of running Postleaf locally (it's intended to run behind a proxy such as Nginx). If you're doing local dev, the [current] requirement is to put the fully URL (including port) in your .env file.

Asset URLs could probably be changed to schemaless URLs. Aside from that, I don't see how the app could know what the proper URL should be.