I'm trying to use an existing nginx running on port 80, to proxypass towards Apache serving a Wordpress website.
nginx section added (some commented tests left intentionally, i tried so many versions sorry if it looks wrong):
upstream wordpress { server 127.0.0.1:5000; } server { server_name media.raw-news.net; access_log /home/plumi/PLUMI/plumi.app/var/log/wordpress-access.log; error_log /home/plumi/PLUMI/plumi.app/var/log/wordpress-error.log; #root /usr/local/apache2/htdocs/; location / { proxy_redirect off; proxy_pass http://wordpress; proxy_connect_timeout 75; proxy_read_timeout 185; } location ~ .*\\.(php)$ { proxy_pass http://wordpress; proxy_redirect off; proxy_set_header Host $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; } } My Apache is running on port 5000 with PHP enabled (only relevant php stuff):
LoadModule php5_module modules/libphp5.so <IfModule dir_module> DirectoryIndex index.php index.html </IfModule> AddType text/html .php AddHandler php5-script .php The effect right now is that:
Chrome: the Wordpress website is shown, but looks like no PHP code is executed.. i can only see the HTML part.
Firefox: browsing the Wordpress site causes redirect on 127.0.0.1 ...
Safari: It Works ! is displayed...
Strangely, on all browsers if i browse http://media.example.net/wp-admin and perform login.. i can enter the Dashboard and everything is displayed perfectly !
All images are there, PHP code gets executed... but only after logging in the Dashboard !
What am i missing here ?
I did not create any VirtualHost in Apache, it is a simple Apache 2.4 server with the Wordpress site inside the default DocumentRoot.
I cannot migrate on newer nginx version cause its running a Production website.
Migration is already planned when Plumi will officially release the 4.5.2 on Debian 8.
Is there any preferred/working configuration to properly proxypass all the Wordpress content to my Apache without having it to redirect to 127.0.0.1 for example, and properly executing PHP Code on Apache ?
Thanks !