Hi,
How to serve static content on static domain cookieless.
I use ngix to serve static content then apache to dynamic content.
Want to serve on static.mydomain.com all static content: jpeg, css, js, ...
Here my actual conf:
server {
listen 80;
client_max_body_size 50M;
server_name www.mydoamin.com;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
location / {
proxy_pass http://IP:8080/;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
root /home/www/domain.com;
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
}
Want all my static content will be delivered only with: static.domain.com
(no duplicate content)
Thanks for your help
Bye