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

[Add expires headers] not working!

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
ADDISON
Posts: 1
Joined: Tue Nov 18, 2014 5:50 am

[Add expires headers] not working!
  • Quote

Post by ADDISON » Tue Nov 18, 2014 6:13 am

This issue is killing me by a week from now. I have a Magento test based on Apache + Nginx VestaCP's configuration.

1) Apache Template -> default
2) Nginx Support enabled. Nginx Template default. Nginx Extensions defaults.
3) SSL support no enabled

Here are Nginx and Apache configuration (I have to mention I did not change anything in VestaCP's installation/configuration).

Location: /home/admin/conf/web

** Nginx Proxy

Code: Select all

server {
    listen      192.168.159.123:80;
    server_name mytestdomain.com www.mytestdomain.com;
    error_log  /var/log/apache2/domains/mytestdomain.com.error.log error;

    location / {
        proxy_pass      http://192.168.159.123:8080;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mp4|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
            root           /home/admin/web/mytestdomain.com/public_html;
            access_log     /var/log/apache2/domains/mytestdomain.com.log combined;
            access_log     /var/log/apache2/domains/mytestdomain.com.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/admin/web/mytestdomain.com/document_errors/;
    }

    location @fallback {
        proxy_pass      http://192.168.159.123:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/admin/conf/web/nginx.mmsport.ro.conf*;
}
** Apache Webserver

Code: Select all

<VirtualHost 192.168.159.123:8080>

    ServerName mytestdomain.com
    ServerAlias www.mytestdomain.com
    ServerAdmin [email protected]
    DocumentRoot /home/admin/web/mytestdomain.com/public_html
    ScriptAlias /cgi-bin/ /home/admin/web/mytestdomain.com/cgi-bin/
    Alias /vstats/ /home/admin/web/mytestdomain.com/stats/
    Alias /error/ /home/admin/web/mytestdomain.com/document_errors/
    #SuexecUserGroup admin admin
    CustomLog /var/log/apache2/domains/mytestdomain.com.bytes bytes
    CustomLog /var/log/apache2/domains/mytestdomain.com.log combined
    ErrorLog /var/log/apache2/domains/mytestdomain.com.error.log
    <Directory /home/admin/web/mytestdomain.como/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
    </Directory>
    <Directory /home/admin/web/mytestdomain.com/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid admin admin
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID admin admin
    </IfModule>

    Include /home/admin/conf/web/apache2.mytestdomain.com.conf*

</VirtualHost>
I installed Magento, it is running perfectly out-of-box but I have a problem. This configuration is not adding expires headers. Mod expires was not enabled in Apache, I enable it. I enable/disable in .htaccess ExpiresDefault. Different scenarios are not working at all.

Code: Select all

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

    #ExpiresDefault "access plus 1 year"

</IfModule>
I don't understand why is not working, because configuration seems to be just fine. I appreciate for any thoughts to solve the mystery. Thank you
Top

wyamout
Posts: 12
Joined: Sat Mar 14, 2015 3:28 am
Contact:
Contact wyamout
Website

Os: Ubuntu 14x
Web: apache
Re: [Add expires headers] not working!
  • Quote

Post by wyamout » Sun Mar 22, 2015 6:59 pm

Hi, did you find a solution to your problem last year?

I have the same settings as you mentioned but for some reason whatever i change to .htaccess its not taking effect... It is like its not enabled or something... Any idea how to enable it?

thanks
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [Add expires headers] not working!
  • Quote

Post by skurudo » Sun Mar 22, 2015 7:30 pm

I have one:
a2enmod headers
then
service apache2 restart
Top


Post Reply
  • Print view

3 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