Welcome! Log In Create A New Profile

Advanced

serve static content on static domain

April 06, 2012 09:41AM
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
Subject Author Posted

serve static content on static domain

zuckbin April 06, 2012 09:41AM

Re: serve static content on static domain

Edho Arief April 06, 2012 09:48AM

Re: serve static content on static domain

zuckbin April 10, 2012 03:47AM

Re: serve static content on static domain

Valentin V. Bartenev April 10, 2012 04:54AM

Re: serve static content on static domain

zuckbin April 11, 2012 03:06AM

Re: serve static content on static domain

Valentin V. Bartenev April 11, 2012 06:32AM

Re: serve static content on static domain

Valentin V. Bartenev April 11, 2012 06:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready