solution-libre / docker-socioboard

Docker-compose setup for starting SocioBoard
GNU General Public License v3.0
11 stars 5 forks source link

When reverse proxying I get mixed content errors #4

Closed kenjibailly closed 2 years ago

kenjibailly commented 2 years ago

CSS files and what not aren't loading, because they are pulled from http instead of https.

image

I thought the APP_URL in the .env file in web should make sure this is https aka:

APP_URL=https://socioboard.mindglowing.art/

Checked, everything seems to be filled in correctly afaik, new to socioboard.

Any idea how I can fix this? I tried contacting ppl from swag (my reverse proxy) aka nginx reverse proxying, but they told me it's a problem within socioboard where I need to tell it to use https instead of http. No idea where I could make sure it does this though.

Any idea's?

My nginx reverse proxy:

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name socioboard.mindglowing.art;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app socioboard_web;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_set_header    X-Forwarded-Proto https;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
    }
}
kenjibailly commented 2 years ago

Fixed this issue by enabling HTTPS using the documentation in Step 12 https://www.linuxbabe.com/ubuntu/install-socioboard-on-ubuntu-20-04

Changing my nginx reverse proxy to upsream_port 443 and proto to https

kenjibailly commented 2 years ago

I recreated the container and can't seem to enable HTTPS anymore. I get this error when trying to certbot apache:

http-01 challenge for socioboard.mindglowing.art
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: socioboard.mindglowing.art
   Type:   unauthorized
   Detail: Invalid response from
   https://socioboard.mindglowing.art/.well-known/acme-challenge/0dxG86m8klu3h_PwrwI1siRiyTiYnRf_BgEG2De299Y
   [***.***.**.***]: 404

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

I tried a bunch of things, but I keep running into the same error. Not sure how to fix this.

kenjibailly commented 2 years ago

Not sure what the issue was. Couldn't get it back to work with certbot. I was able to however manually add an apache cert and enable https, which solved the issue again.

Ref: https://techexpert.tips/apache/enable-https-apache/

ghost commented 2 years ago

Add ASSET_URL=https://socioboard.mindglowing.art/