LycheeOrg / Lychee-Docker

Docker image for Lychee
https://lycheeorg.github.io/
165 stars 56 forks source link

app.js & app.css cannot be loaded #166

Closed sigulete closed 1 year ago

sigulete commented 1 year ago

I'm having a strange problem that happens only when I connect to my server using HTTPS protocol.

Explanation of my setup

What is working?

What is not working?

image

ildyria commented 1 year ago

Can you check the content of your apache site enabled for Lychee ? I am using docker, but the process is probably similar for yours:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName photography.viguier.nl

#   DocumentRoot /var/www/Lychee
    ProxyPass / http://localhost:90/
    ProxyPassReverse / https://photography.viguier.nl/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on

    Header always set Strict-Transport-Security "max-age=31536000"
    BrowserMatch    "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
    RequestHeader set X-Forwarded-SSL expr=%{HTTPS}

    SSLCertificateFile /etc/letsencrypt/live/<some site>/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/<some site>/privkey.pem
</VirtualHost>
</IfModule>

and I also have the TRUSTED_PROXIES=* set.

sigulete commented 1 year ago

I added the following configuration based on your setup, and it worked:

RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
RequestHeader set X-Forwarded-SSL expr=%{HTTPS}