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.