Closed chrisb86 closed 6 years ago
Mmmm. What's the content of php_handler.conf
? For reference, here's my reverse proxy config:
# Firefly III
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
client_max_body_size 64M;
proxy_pass http://127.0.0.1:8090$uri$is_args$args;
}
It is a slightly different setup but as you can see, I am also setting some headers to make Firefly III (it's a Docker image) know what the URL + protocol should be.
php_handler.conf
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include includes/fastcgi_params.conf;
fastcgi_params.conf
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_max_temp_file_size 0;
I found a solution now.
nginx doesn't pass the HTTPS server variable to PHP.
I put fastcgi_param HTTPS 'on';
in my fastcgi params and it works now. I found the solution here: https://ma.ttias.be/setting-https-server-variables-in-php-fpm-with-nginx/
Nice, thanks for reporting back with the solution. I must admit I am a bit out of my league. When nginx is a reversed proxy you can do the $scheme thing.
I am running Firefly III version 4.7.7
Description I can't get Firefly III working with nginx and php-fpm on FreeBSD. My server redirects all http traffic to https but Firefly III just refers http for everything. I can't send forms and get mixed content warning all the way.
I set APP_URL to https://firefly.example.com and TRUSTED_PROXIES to **.
I tried to disable al headers that nginx will send but noting changed.
Extra info Debug information generated at 2018-10-07 00:25:45 Europe/Berlin for Firefly III version 4.7.7.
nginx config