View Single Post
Old 09-17-2009, 07:11 AM   #8
ISPsystem team
 
slava's Avatar
 
Join Date: May 2008
Location: ISPsystem
Posts: 588
slava is on a distinguished road
Default

Quote:
so what is apache used for then?
1. ISPmanager core needs apache, because ispmgr runs through apache SSL port.

2. Nginx proxyng requests to apache and transfers static content, for example from nginx.conf

Code:
        server {
                listen 193.0.0.193:80;
                server_name example.com www.example.com;
                rewrite ^(/manager/.*)$ https://$host$1 permanent;
                location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
                        proxy_pass http://193.0.0.193:8080;
                        proxy_redirect http://example.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 / {
                        proxy_pass http://193.0.0.193:8080;
                        proxy_redirect http://example.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 /home/web/data/www/example.com;
                        access_log /home/httpd-logs/example.com.access.log;
                        error_page 404 = @fallback;
                }
                location @fallback {
                        proxy_pass http://193.0.0.193: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;
                }
        }

Apache back-end listen port 8080 and execute php/cgi-scripts, nginx front-end listen http port 80 and send data to web-browser and proxying request for static content files directly.

Last edited by tanya; 10-06-2009 at 05:04 AM.
slava is offline