Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nginx



???? ? ????????? ????? ??????, ?? ????

location / {
? ? root?/var/www/cache/data/www/????????/templates/??????????/;
? ? error_page 404 =200?/var/www/system/data/www/system.com/templates/;
}

8 ???? 2011??. 17:24 ???????????? Userolog <nginx-forum@xxxxxxxx> ???????:
???????????? ??? ??????? ??????. ????
??????, ??????? html ????? ?
/var/www/system/data/www/system.com/templates/

? ?? ????????? ? ? ??????? ???????,
????

/templates/odin/
/templates/dva/

? ??? ?????.

? ? ???? ???? ???????? ???? ????? -
header.jpg, ??????? ???????? ?? ?????
/var/www/system/data/www/system.com/templates/??????????/header.jpg

?????? ????????? ????????????? ?????
?????, ?? ????????? ? ???????
/var/www/cache/data/www/????????/templates/??????????/

??? ??? ????? - ????? ?????
(?????????????? ??????).

????? ???????, ????? ????????????
?????? nginx ???, ????? ???? ?????
?????????? ?
/var/www/cache/data/www/????????/templates/??????????/,
?? ?????? ??????. ???? ???, ?? ?????? ?
/var/www/system/data/www/system.com/templates/.

??????: ??? ????????????

?????? nginx

server {
listen 127.0.0.1:80;
server_name system.com www.system.com;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
error_page 404 = @fallback;

#files cache
location / {
root /var/www/cache/data/www/$host_without_www;
try_files $uri @backend;
}
#end for cache folder
location /templates/
{
root /var/www/;
try_files /cache/data/www/$host/templates$uri
/system/data/www/$host/templates$uri @dummy;
}
location @dummy { return 444; }

location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://system.com:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
set $host_without_www $host;
if ($host ~* www\.(.*)) {
set $host_without_www $1;
}
location ~ ^/$ {
rewrite .* /index.html;
}

location @backend {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://system.com:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}


location ~*
^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
root /var/www/system/data/www/system.com;
access_log /var/www/httpd-logs/system.com.access.log;

location ~ /files {
root /var/www/cache/data/www/$host_without_www;
}

}

location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}


?????? 0.7.67

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,212026,212026#msg-212026


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru

  • References:

 




Copyright © Lexa Software, 1996-2009.