答案1
也许您必须设置如下 HTTP 标头:
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;
希望对你有帮助。
答案2
那么你可以使用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;
}
}
您还可以访问Apache -->>PHP-FPM
(文档)
<VirtualHost *:8081>
ServerName example.com
ProxyPreserveHost On
ProxyPass / fcgi://127.0.0.1:9000/
ProxyPassReverse / fcgi://127.0.0.1:9000/
</VirtualHost>