Plausible Analytics proxy problems after restart

Hi there,

first of all - thanks for cleavr, it’s really a great tool to manage servers.

At the moment, I try setting up the Plausible Analytics proxy. I’ve did everything as described here:

My problem is, when I reboot the server, the folder /var/run/nginx-cache is gone and Nginx comes up with an error:

ERRORas of27.12.2021, 07:35:56
NGINX CONFIGURATION ERROR

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] mkdir() "/var/run/nginx-cache/jscache" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
---Error Log---
2021/12/27 06:35:56 [emerg] 2673#2673: mkdir() "/var/run/nginx-cache/jscache" failed (2: No such file or directory)
2021/12/27 06:35:56 [emerg] 2671#2671: mkdir() "/var/run/nginx-cache/jscache" failed (2: No such file or directory)
2021/12/27 06:33:46 [emerg] 631#631: mkdir() "/var/run/nginx-cache/jscache" failed (2: No such file or directory)
2021/12/27 06:32:29 [emerg] 628#628: mkdir() "/var/run/nginx-cache/jscache" failed (2: No such file or directory)

When I recreate the folder manually (SSH or by a Quick Script) and restart Nginx, everything works fine. Do you have a solution for this?

Thanks,
Sebastian

Hello Sewid,

We’re glad that you’re finding Cleavr helpful.

It’s obvious that some files from /var/run get cleared during reboot. I think running a quick script after server reboot can be one of the solutions.

Let’s see if someone from the community has any other approach to this.

Hi anish, I found a solution here. By using Ubuntu Manpage: tmpfiles.d - Configuration for creation, deletion and cleaning of volatile and temporary, you can create folders on system startup.

Tried it and it works :slight_smile:

2 Likes