• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Nginx add_header not woking inside locations

bernhardh86

Basic Pleskian
I am now trying around since hours, but I can't get in work.

On apache&nginx settings page, I have turned off proxy mode and the "static files direct" option. Then I have added this (and only this) additional config to the textarea:

```
location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|webp)$ {
access_log off;
expires 365d;
add_header 'Cache-Control' "public, max-age=365";
}
```

This should add the "Cache-Control" setting on all static media files and it is based on this: Additional nginx directives are not applied when nginx proxy mode is disabled in Plesk

But it doesn't work. Chrome doesn't show it.

Then I have tried to remove everything but the `add_header ..` line:

```
add_header 'Cache-Control' "public, max-age=365";
```

And now its working, but of course for all files, not only media files.

I have even tried this:

```
location / {
add_header 'Cache-Control' "public, max-age=365";
}
```

and it is not adding the header.


Anybody an idea, why its not working as expected.
 
Ok. It looks like my problem was, that I used the "password protected directory" function, which breaks some nginx config features. Turning it off and protecting the folders manually works without problems
 
Back
Top