I have a Debian 6 32-bit Linode where I’m trying to run EE2.5.5 in Apache2 on port 8080 behind nginx0.7.
The idea is to serve PHP code from Apache, and everything else from nginx.
(Based on http://hybridlogic.co.uk/2011/07/setting-up-nginx-in-front-of-apache2-on-ubuntu-server/)
The outputs below (sitename replaced by “website”) show more or less what has been configured.
So far image uploading and editing works with the settings
* Server Path to Upload Directory: /srv/www/website/static_content/
* URL of Upload Directory: http://www.website/
I’d be grateful for any feedback on the security, viability and any hidden gotchas with this setup.
Thansk!
root@phoenix:/var/www/website# ls
logs php_content static_content
root@phoenix:/var/www/website# ls static_content/
images themes system
root@phoenix:/var/www/website# ls php_content/
admin.php index.php setperm.sh system themes
root@phoenix:/var/www/website# cat /etc/nginx/sites-available/website
server {
listen 80;
access_log /srv/www/website/logs/nginx.access.log;
error_log /srv/www/website/logs/nginx.error.log;
root /srv/www/website/static_content;
index index.php index.html;
server_name website;
rewrite ^/$ http://www.website/index.php;
location \ {
try_files $uri $uri/ index.php/$uri;
}
location ~* ^.*\.php\b {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.(ht|git) {
deny all;
}
}
root@phoenix:/var/www/website# cat /etc/apache2/sites-available/website
<VirtualHost *:8080>
ServerAdmin webmaster@website
ServerName website
ServerAlias http://www.website
DocumentRoot /srv/www/website/php_content/
ErrorLog /srv/www/website/logs/error.log
CustomLog /srv/www/website/logs/access.log combined
</VirtualHost>
root@phoenix:/var/www/website#