server {
listen xx.xx.xx.xx:80;
server_name site.ru *.site.ru www.site.ru;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
error_page 404 = @fallback;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/|pgadmin/) {
proxy_pass http://xx.xx.xx.xx: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://xx.xx.xx.xx: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|swf)$ {
root /var/www/user/data/www/site.ru;
access_log /var/www/httpd-logs/site.ru.access.log ;
access_log /var/www/nginx-logs/user isp;
}
location @fallback {
proxy_pass http://xx.xx.xx.xx: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;
}
}
server {
listen xx.xx.xx.xx:80;
server_name site.ru *.site.ru www.site.ru;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
error_page 404 = @fallback;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/|pgadmin/) {
proxy_pass http://xx.xx.xx.xx: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://xx.xx.xx.xx: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 '/' {
location '/templates' {
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/user/data/www/site.ru;
access_log /var/www/httpd-logs/site.ru.access.log ;
access_log /var/www/nginx-logs/user isp;
}
}
location '/' {
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/user/data/www/site.ru;
access_log /var/www/httpd-logs/site.ru.access.log ;
access_log /var/www/nginx-logs/user isp;
}
}
}
location @fallback {
proxy_pass http://xx.xx.xx.xx: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;
}
}