Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

How to add cache control in the nginx-apache webserver

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
5 posts • Page 1 of 1
qwerz
Posts: 5
Joined: Sat Apr 14, 2018 5:08 pm

Os: CentOS 6x
Web: apache + nginx
How to add cache control in the nginx-apache webserver
  • Quote

Post by qwerz » Sat Apr 14, 2018 5:14 pm

Hi there,

I am using a CDN which requires me to set a Max Age and "public" in the origin server which currently uses vestacp (Nginx+apache).

I tried settings this in the .htaccess:

Code: Select all

# One month for most static assets
<FilesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2628000, public"
</FilesMatch>
That does not work though. The header still says "cache-control: max-age=315360000"
Not sure where this 315360000 comes from. I assume vestaCP has it set somewhere in nginx or apache..

I tried searching in the vestaCP advanced server configuration for that number and 'cache control' as well. But couldnt find anything that sets that number.

Any tips on how to get this sorted? Maybe override it in some way by htaccess?

Thanks!
Top

qwerz
Posts: 5
Joined: Sat Apr 14, 2018 5:08 pm

Os: CentOS 6x
Web: apache + nginx
Re: How to add cache control in the nginx-apache webserver
  • Quote

Post by qwerz » Tue Apr 17, 2018 6:31 pm

This is really frustrating. Something within Vesta is overwriting the htaccess settings.

I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.

Still couldn't find out what it is >:(
Top

qwerz
Posts: 5
Joined: Sat Apr 14, 2018 5:08 pm

Os: CentOS 6x
Web: apache + nginx
Re: How to add cache control in the nginx-apache webserver
  • Quote

Post by qwerz » Thu Apr 26, 2018 6:58 pm

qwerz wrote: ↑
Tue Apr 17, 2018 6:31 pm
This is really frustrating. Something within Vesta is overwriting the htaccess settings.

I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.

Still couldn't find out what it is >:(
It seems Apache or nginx does this automatically on VestaCP. Can someone confirm? and where to change that setting? Because it ignores htaccess for this matter on vesta standard.
Top

noogen
Posts: 66
Joined: Thu Jan 05, 2017 9:20 pm

Re: How to add cache control in the nginx-apache webserver
  • Quote

Post by noogen » Wed May 02, 2018 7:24 pm

The default setting in Vesta NGINX to expire: max - http://nginx.org/en/docs/http/ngx_http_ ... ml#expires
315360000 = 10 years per the documentation

You can override this in your panel config. Under Vesta - WEB configuration, look at the nginx proxy section. Remove all extension you do not want this in the Proxy Extensions section.
Top

petra
Posts: 1
Joined: Fri May 04, 2018 3:56 am

Os: Ubuntu 14x
Web: apache + nginx
Re: How to add cache control in the nginx-apache webserver
  • Quote

Post by petra » Fri May 04, 2018 3:58 am

qwerz wrote: ↑
Tue Apr 17, 2018 6:31 pm
This is really frustrating. gmail sign up Something within Vesta is overwriting the htaccess settings.

I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.

Still couldn't find out what it is >:(
This is frustrating....
Top


Post Reply
  • Print view

5 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password