0

trying to install nginx with apache revers proxy, apache itself does sent to php-fpm to port 9000 on localhost

so apache http on port 8081, apache https 444

nginx 80 and nginx ssl 443

php-fpm port 9000

Via port http wordpress looks ok, if i open it via https looks like no css/js is passed through. Any suggestion?

image1 image2 image3 image4

2 Answers2

0

Maybe you must set HTTP header like :

proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Front-End-Https on;

Hope this will help you.

YonzLeon
  • 311
  • 2
  • 7
0

Well you can use Apache -->> Nginx -->> PHP-FPM

#Apache
<VirtualHost *:8081>
    ServerName example.com
    ProxyPreserveHost On
ProxyPass / http://127.0.0.1:80/
ProxyPassReverse / http://127.0.0.1:80/

</VirtualHost>

#Nginx server {
listen 80; root /var/www/; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; # gzip_static on; }

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {        
    fastcgi_pass php:9000;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~ /\.(?!well-known).* {
    deny all;
}

}

You also can go Apache -->>PHP-FPM (Docs)

<VirtualHost *:8081>
    ServerName example.com
    ProxyPreserveHost On
    ProxyPass / fcgi://127.0.0.1:9000/
    ProxyPassReverse / fcgi://127.0.0.1:9000/
</VirtualHost>