How to Easily Switch Apache to Nginx?



 How to Easily Switch from Apache to Nginx?

You'll want to edit the following files to have Apache listen in on port 8080:

in /etc/apache2/ports.conf:

NameVirtualHost *:8080
Listen 8080

And then in your virtual host files (/etc/apache2/sites-available/)

<VirtualHost *:8080>

Then add something like this to your Nginx config's 'server' area:

location ~ \.php$ {
    proxy_pass http://127.0.0.1:8080;
    proxy_redirect off;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    client_max_body_size 10m;
    client_body_buffer_size 128k;

    proxy_connect_timeout 90;
    proxy_send_timeout 90;
    proxy_read_timeout 90;

    proxy_buffer_size 4k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
}

{ 0 comments... read them below or add one }

Post a Comment