martin-helmich / docker-typo3

A docker image for running TYPO3
GNU General Public License v3.0
104 stars 75 forks source link

Reverse proxy nginx and Typo3 11.5 does not deliver all images in the backend #224

Open mathiasrettich opened 2 years ago

mathiasrettich commented 2 years ago

Hello, everyone, I have a small website for my NWT teaching. It's in the school network: grafik Port 80 is passed through to port 7775 on the Docker host computer. If I access the Docker host directly from a computer in the school network with http://dockerhost:7775/typo3/ everything works exactly as it should. However, when I access https://wwwmc.myschool.de/typo3/ from the school network or the Internet, some images are not displayed in the backend: grafik If I log in again via http://dockerhost:7775/typo3/ then the image is displayed correctly. If I then go back to the same page via https://wwwmc.meineschule.de/typo3/, is it strangely displayed correctly?!? grafik Outside of the backend, the pages are displayed correctly. I assume that I have to make entries for the reverse proxy nginx. Unfortunately, I still haven't figured out what I'm in [SYS][reverseProxyIP], [SYS][reverseProxyHeaderMultiValue], [SYS][reverseProxyPrefix], [SYS][reverseProxySSL] and [SYS][reverseProxyPrefixSSL] must enter. This is the nginx configuration file for the website (just in case):

server {
    listen [::]:80;
    listen 80;

    server_name wwwmc.myschool.de;

    location / {
      return 301 https://wwwmc.myschool.de$request_uri;
      }
# this is for renewal of Let's encrypt certificates
##########################################################
    location ^~ /.well-known/acme-challenge {
      alias /var/www/dehydrated;
      }
##########################################################
}

server {
    listen [::]:443 ssl http2;
    listen 443 ssl http2;

    server_name wwwmc.myschool.de;

    ssl_certificate /var/lib/dehydrated/certs/wwwmc.myschool.de/fullchain.pem;
    ssl_certificate_key /var/lib/dehydrated/certs/wwwmc.myschool.de/privkey.pem;
    ssl_protocols TLSv1.2;
    ssl_prefer_server_ciphers on;

    root /var/www/html;
    index index.php index.html;

    location / {
       access_log /var/log/nginx/wwwmc.access.log;
       error_log /var/log/nginx/wwwmc.error.log;
       proxy_pass http://localhost:7775;
    }
}

This is of course not an error, but maybe there is a tip that solves this problem. I would like to thank you in advance for thinking along with me.

martin-helmich commented 1 year ago

Sorry for the late response. TBH, off the top of my head, I don't have any clue on this one. 🙁

You could try to verify from which host the images are actually requested in your backend (maybe they're not displayed because they're requested via HTTP, whereas your site is served via HTTPS) or (in case the images are requested from the correct host) from which URL exactly (maybe some cache isn't warmed up correctly) and with which status code.

rintisch commented 8 months ago

@mathiasrettich have you tried a wildcard value for reverseProxyIP?

For me a similar setup works with

'reverseProxyHeaderMultiValue' => 'last',
'reverseProxyIP' => '10.0.0.0/8,172.16.0.0/12,192.168.0.0/16',
'reverseProxySSL' => '*',