Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2012 16:22
Show Gist options
  • Save anonymous/1933451 to your computer and use it in GitHub Desktop.
Save anonymous/1933451 to your computer and use it in GitHub Desktop.
server {
server_name %MySite%.ru www.%MySite%.ru;
listen %MyIP%;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/%MySite%/data/www/%MySite%.ru;
access_log /var/www/nginx-logs/%MySite% isp;
access_log /var/www/httpd-logs/%MySite%.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://%MyIP%:81;
proxy_redirect http://%MyIP%:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://%MyIP%:81;
proxy_redirect http://%MyIP%:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://%MyIP%:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
include /usr/local/ispmgr/etc/nginx.inc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment