vessel icon indicating copy to clipboard operation
vessel copied to clipboard

Clockwork debugger blank because of expires.conf

Open madsem opened this issue 5 years ago • 4 comments

Description

I've installed the Clockwork debugger: https://underground.works/clockwork/#docs-installation When accessing the local Clockwork app under http://localhost/__clockwork/app it gives a blank screen, and debug tools in browser show that all Clockwork images,js and css files return a 404.

Tracked the problem down to docker/app/h5bp/location/expires.conf, specifically the expires rule for images, json and js/css files.

When removed, and then vessel down followed by vessel build app Clockwork starts working.

My knowledge of nginx config is a bit rusty, so I'm unsure what could be done to fix this. Hoping we can integrate a fix so that I don't have to manually do this every time I install or update Clockwork? 👯‍♂️

OS

macOS Catalina 10.15.4

My OS is:

  • [*] MacOS [Choose one: Yosemite, El Capitan, Sierra, High Sierra, Mojave]
  • [ ] Linux
  • [ ] Windows

Docker

The output of docker version:

> docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

The output of docker-compose version:

> docker-compose version
docker-compose version 1.25.5, build 8a1c60f6
docker-py version: 4.1.0
CPython version: 3.7.5
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020

madsem avatar May 21 '20 09:05 madsem

Hi!

What did you remove exactly? (did you delete that file? or remove reference to h5bp from nginx config file? something else?)

I'm not sure the expires file makes the most sense since it just affects what headers Nginx returns when serving the file (but doesn't contain any rules blocking the serving of any files).

fideloper avatar May 21 '20 12:05 fideloper

Hey Chris, thanks for speedy reply.

I forgot to mention I opened this in reference to #https://github.com/itsgoingd/clockwork/issues/340

I've commented out these three:

# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
  expires -1;
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
  expires 1M;
  access_log off;
  add_header Cache-Control "public";
}

# CSS and Javascript
location ~* \.(?:css|js)$ {
  expires 1y;
  access_log off;
}

Then rebuild the app container, and it started to work. Also verified that it stops working again when reintroducing those three locations in the expires.conf

madsem avatar May 21 '20 12:05 madsem

Thanks!

I don't really get why that caused an issue, perhaps the browser cached the fact that it couldn't find those files?

We'll be updating this project to use Ubuntu 20.04 fairly soon, which might be a good time to remove/not use cache rules (especially since Vessel is meant for local dev).

fideloper avatar May 21 '20 12:05 fideloper

Yeah it's weird, but probably to do with how Clockwork delivers the files, as they aren't in the public dir of Laravel.

Good to hear about 20.04! Love Vessel btw, using it exclusively. Thanks for your hard work :)

PS: figured it should stay open haha, or close it if you prefer that.

madsem avatar May 21 '20 12:05 madsem