Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Cannot Access Akaunting Via HTTPS

Denis Dulici   ( Admin )

Commented 6 years ago

Calvin, you will need to publish the config file and set it up as mentioned here.

Calvin Levy   ( User )

Commented 6 years ago

Denis, I now have the Akaunting app in /var/www/html and the Laravel PHP framework in /var/www/html/laravel.  After a couple of unsuccessful attempts, although the changes seems to work without error, exactly which folder should receive the fideloper/proxy modifications. 


For example, should I:


nano /var/www/html/config/app.php
or
nano /var/www/html/laravel/config/app.php?


Apolgies if this seems a simple question.  This is my first attempt using fideloper/proxy.


Should the Laravel framework live one level up? /var/www/laravel?

Calvin Levy   ( User )

Commented 6 years ago

Hello Denis.  I finally got back to this issue with a fresh mind.  Took long enough.... :-)  I am finally successful with presenting Akaunting behind an Apache Proxy Server.  The "mixed content" issue exists.

Calvin Levy   ( User )

Commented 4 years ago

Hello Akaunting Team. A quick note of update. Although working mostly, I am still from time to time attempting for 100% operation. Currently, the "Mixed Content" issue still exists. This only affects graphical images and charts displaying via HTTPS over Apache proxy. Via HTTP, all graphical images display correctly. This affects both admin access and the customer portal.

Client--->Internet--->Apache Proxy Server via vHost--->Internal Dedicated Akaunting Server fideloper/proxy installed.

I have gotten creative with the vHost settings that has helped resolve problems with other applications accessed in the same manner but with Akaunting, still as stated above with Mixed Content issue. Using guidance from Mozilla Firefox and others did not resolve the issue.

Wu Wuu Jiann   ( User )

Commented 3 years ago

I encountered the same problem using traefik proxy. Managed to find the solution from Akaunting's doc https://akaunting.com/docs/developer-manual/reverse-proxy

Below are the steps I followed to fix the problem

1. Go into the akaunting container:
$ docker exec -it acct_akaunting_1 bash

2. Publish TrustedProxy package
# php artisan vendor:publish --provider="Fideloper\Proxy\TrustedProxyServiceProvider"

3.Edit config/trustedproxy.php file (in my case, the full path is /var/www/akaunting/config/trustedproxy.php). Since 'vi' or 'nano' is not available in the docker container, I used 'sed' command to modify the 'proxy' line.

# cat config/trustedproxy.php | sed "s/# 'proxies' => '\*'/'proxies' => '*'/" > /tmp/trustedproxy.php

4. Ensure that the changes made is correct:
# diff config/trustedproxy.php /tmp
35c35
< # 'proxies' => '*',
---
> 'proxies' => '*',

5. Replace the trustedproxy.php file with the modified one
# mv /tmp/trustedproxy.php config

NOTE: Please ensure that https is used for AKAUNTING_URL in docker-compose.yml file. E.g., - AKAUNTING_URL=https://xxx

Kaushik Bv   ( User )

Commented 8 months ago

Hi,

I modified my Nginx Configuration a little bit and the application works fine.
The problem seems to be mixed content.

Just modify the location configuration as

location / {
proxy_pass http://0.0.0.0:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header X-Forwarded-Proto https;
sub_filter 'http://example.com' 'https://example.com';
sub_filter_once off;
sub_filter_types *;
}

Mention your domain in example.com and it should be working.
The Subfilter helps in resolving Mixed Content Problems.

Please login or register to leave a response.

Showing 11 to 16 of 16 discussions