[Add expires headers] not working!
[Add expires headers] not working!
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
** Apache Webserver
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.
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
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*;
}
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>
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>
Re: [Add expires headers] not working!
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
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
Re: [Add expires headers] not working!
I have one:
thena2enmod headers
service apache2 restart