server listen 88 188 188 88 80 server_name site ru www site ru rewrite

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
server {
listen 88.188.188.88:80;
server_name site.ru www.site.ru;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
proxy_pass http://88.188.188.88:8080;
proxy_redirect http://site.ru: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 / {
proxy_pass http://88.188.188.88:8080;
proxy_redirect http://site.ru: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 /home/alex/data/www/site.ru;
access_log /home/httpd-logs/site.ru.access.log;
}
location /admin-media/ {
alias /usr/local/lib/python2.5/site-packages/django/contrib/admin/media/;
expires 10d;
}
location @fallback {
proxy_pass http://88.188.188.88:8080;
}
}