Caddy with Symfony and nested static MKDocs sites

1. Output of caddy version:

v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=

2. How I run Caddy:

Docker container, currently only localhost on 80 and 443.

a. System environment:

Windows 11 x64 22H2 - Docker Desktop v4.15.0 - WSL

b. Command:

docker-compose build
docker-compose up -d

c. Service/unit/compose file:

# Base production image for CiviCRM Docs Publisher
FROM php:8.2-fpm-alpine as docs-publisher
ARG TIMEZONE
## Allow use of development versions of Symfony
ARG STABILITY="stable"
ENV STABILITY ${STABILITY}
## Allow selection of Symfony version
ARG SYMFONY_VERSION=""
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
## Set application environment type
ENV APP_ENV=prod
## Set working directory
WORKDIR /srv/docs-publisher
## PHP extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer --link /usr/bin/install-php-extensions /usr/local/bin/
# Setup / install runtime dependencies
RUN apk add --no-cache \
	acl \
	fcgi \
	file \
	gettext \
	git \
	unzip \
	py3-pip \
	;
RUN set -eux; \
	install-php-extensions \
	intl \
	zip \
	apcu \
	opcache \
	;
RUN pip install mkdocs-material==8.5.11
## Copy in scaffolding and preference files
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf
RUN mkdir -p /var/run/php
## Setup healthcheck
COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
## Schedule healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
## Setup entrypoint
COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
# Composer Setup
## https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
## Copy in Composer
COPY --from=composer/composer:2-bin --link /composer /usr/bin/composer
## Don't reinstall entire vendor tree on a code change
COPY composer.* symfony.* ./
RUN set -eux; \
	if [ -f composer.json ]; then \
	composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \
	composer clear-cache; \
	fi
# Application Setup
## Copy sources
COPY --link  . .
## Cleanup docker folder
RUN rm -Rf docker/
## Set file / directory permissions
RUN set -eux; \
	mkdir -p var/cache var/log; \
	if [ -f composer.json ]; then \
	composer dump-autoload --classmap-authoritative --no-dev; \
	composer dump-env prod; \
	composer run-script --no-dev post-install-cmd; \
	chmod +x bin/console; sync; \
	bin/console docs:publish; \
	fi
## Set timezone
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone \
	&& printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini \
	&& "date"
# Development image for CiviCRM Docs Publisher
FROM docs-publisher AS docs-publisher-dev
## Set application environment type
ENV APP_ENV=dev XDEBUG_MODE=off
## Set working directory
VOLUME /srv/docs-publisher/var/
## Copy in scaffolding and preference files
RUN rm $PHP_INI_DIR/conf.d/app.prod.ini; \
	mv "$PHP_INI_DIR/php.ini" "$PHP_INI_DIR/php.ini-production"; \
	mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
## Install development dependencies
RUN set -eux; \
	install-php-extensions xdebug
## Remove local environment variable file.
RUN rm -f .env.local.php
# Web Server image for CiviCRM Docs Publisher
## Build Caddy with the Mercure and Vulcain modules
FROM caddy:2.6-builder-alpine AS docs-publisher-caddy-builder
RUN xcaddy build \
	--with github.com/dunglas/mercure \
	--with github.com/dunglas/mercure/caddy \
	--with github.com/dunglas/vulcain \
	--with github.com/dunglas/vulcain/caddy
## Caddy hosting image.
FROM caddy:2.6-alpine AS docs-publisher-caddy

WORKDIR /srv/docs-publisher

COPY --from=docs-publisher-caddy-builder --link /usr/bin/caddy /usr/bin/caddy
COPY --from=docs-publisher --link /srv/docs-publisher/public public/

docker-compose.yml

version: "3.4"

services:
  php:
    build:
      context: .
      target: docs-publisher
      args:
        SYMFONY_VERSION: ${SYMFONY_VERSION:-}
        STABILITY: ${STABILITY:-stable}
        TIMEZONE: europe/london
    restart: unless-stopped
    volumes:
      - php_socket:/var/run/php
    healthcheck:
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
    environment:
      # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
      MERCURE_URL: ${CADDY_MERCURE_URL:-http://caddy/.well-known/mercure}
      MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
      MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}

  caddy:
    build:
      context: .
      target: docs-publisher-caddy
    depends_on:
      - php
    environment:
      SERVER_NAME: ${SERVER_NAME:-localhost, caddy:80}
      MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
      MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
    restart: unless-stopped
    volumes:
      - docker/caddy/Caddyfile:/etc/caddy/Caddyfile
      - php_socket:/var/run/php
      - caddy_data:/data
      - caddy_config:/config
    ports:
      # HTTP
      - target: 80
        published: ${HTTP_PORT:-80}
        protocol: tcp
      # HTTPS
      - target: 443
        published: ${HTTPS_PORT:-443}
        protocol: tcp
      # HTTP/3
      - target: 443
        published: ${HTTP3_PORT:-443}
        protocol: udp

# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###
volumes:
  php_socket:
  caddy_data:
  caddy_config:
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###

d. My complete Caddy config:

{
	# Debug
	{$CADDY_DEBUG}
}

{$SERVER_NAME}

{$CADDY_EXTRA_CONFIG}

log

route {
	root * /srv/docs-publisher/public
	mercure {
		# Transport to use (default to Bolt)
		transport_url {$MERCURE_TRANSPORT_URL:bolt:///data/mercure.db}
		# Publisher JWT key
		publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
		# Subscriber JWT key
		subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
		# Allow anonymous subscribers (double-check that it's what you want)
		anonymous
		# Enable the subscription API (double-check that it's what you want)
		subscriptions
		# Extra directives
		{$MERCURE_EXTRA_DIRECTIVES}
	}
	vulcain
	push
	encode zstd gzip
	@canonicalPath {
		file {path}/index.html
		not path */
	}
	redir @canonicalPath {http.request.orig_uri.path}/ 308
	php_fastcgi unix//var/run/php/php-fpm.sock {
		try_files {path} {path}/index.php {path}/index.html index.php
		# Add trailing slash for directory requests
	}
	file_server
}

3. The problem I’m having:

When trying to navigate to any of the nested static sites (which live in the public folder above which is mapped from the php-fpm container to the caddy container) in the webroot returns a 404 for the path without /, with / and direct to index.html. Removal of the @canonicalPath directive and following redir allows the path with / and index.html to work but paths without / still fail.

I am seeking a solution which allows all three of the above to resolve correctly.

4. Error messages and/or full log output:

2022-12-22 00:39:00 {
  "level": "error",
  "ts": 1671669540.8874893,
  "logger": "http.log.access",
  "msg": "handled request",
  "request": {
    "remote_ip": "172.19.0.1",
    "remote_port": "43260",
    "proto": "HTTP/2.0",
    "method": "GET",
    "host": "localhost",
    "uri": "/handbook/en/latest/",
    "headers": {
      "Accept-Encoding": ["gzip, deflate, br"],
      "Sec-Fetch-Dest": ["document"],
      "Sec-Fetch-Mode": ["navigate"],
      "Sec-Fetch-Site": ["none"],
      "Te": ["trailers"],
      "User-Agent": [
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
      ],
      "Accept": [
        "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
      ],
      "Accept-Language": ["en-GB,en;q=0.5"],
      "Upgrade-Insecure-Requests": ["1"],
      "Sec-Fetch-User": ["?1"]
    },
    "tls": {
      "resumed": false,
      "version": 772,
      "cipher_suite": 4865,
      "proto": "h2",
      "server_name": "localhost"
    }
  },
  "user_id": "",
  "duration": 0.070854917,
  "size": 18531,
  "status": 404,
  "resp_headers": {
    "Status": ["404 Not Found"],
    "Content-Encoding": ["gzip"],
    "Vary": ["Accept-Encoding"],
    "Server": ["Caddy"],
    "Alt-Svc": ["h3=\":443\"; ma=2592000"],
    "Content-Type": ["text/html; charset=UTF-8"],
    "X-Debug-Exception": [
      "Sorry%2C%20the%20book%20you%20requested%20does%20not%20exist.%20Please%20check%20the%20URL%20and%20try%20again%21"
    ],
    "X-Debug-Exception-File": [
      "%2Fsrv%2Fdocs-publisher%2Fsrc%2FEventSubscriber%2FExceptionSubscriber.php:31"
    ]
  }
}

5. What I already tried:

Discord discussion here: Discord

6. Links to relevant resources:

Currently running version (not using Docker): https://docs.civicrm.org

Can you turn on the debug global option and show the logs you see from a request with that? It might reveal more details about the rewrites and such.

The debug request led to the following logs:

2022-12-22 01:37:34 {"level":"debug","ts":1671673054.8551075,"logger":"http.handlers.rewrite","msg":"rewrote request","request":{"remote_ip":"172.19.0.1","remote_port":"38916","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/handbook/en/latest/","headers":{"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Te":["trailers"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"method":"GET","uri":"/index.php"}
2022-12-22 01:37:34 {"level":"debug","ts":1671673054.8551388,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"/var/run/php/php-fpm.sock","total_upstreams":1}
2022-12-22 01:37:34 {"level":"debug","ts":1671673054.8552573,"logger":"http.reverse_proxy.transport.fastcgi","msg":"roundtrip","request":{"remote_ip":"172.19.0.1","remote_port":"38916","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Sec-Fetch-Site":["none"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-User":["?1"],"Te":["trailers"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"X-Forwarded-Host":["localhost"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"env":{"GATEWAY_INTERFACE":"CGI/1.1","REMOTE_HOST":"172.19.0.1","REQUEST_URI":"/handbook/en/latest/","HTTP_X_FORWARDED_FOR":"172.19.0.1","AUTH_TYPE":"","REQUEST_METHOD":"GET","REQUEST_SCHEME":"https","CONTENT_LENGTH":"","SERVER_SOFTWARE":"Caddy/v2.6.2","HTTP_HOST":"localhost","SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_SEC_FETCH_MODE":"navigate","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","QUERY_STRING":"","REMOTE_ADDR":"172.19.0.1","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php","SCRIPT_NAME":"/index.php","SERVER_PORT":"443","HTTP_SEC_FETCH_DEST":"document","HTTP_SEC_FETCH_SITE":"none","HTTP_ACCEPT":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","REMOTE_IDENT":"","PATH_INFO":"","REMOTE_PORT":"38916","SERVER_NAME":"localhost","DOCUMENT_URI":"/index.php","HTTPS":"on","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_X_FORWARDED_PROTO":"https","REMOTE_USER":"","SERVER_PROTOCOL":"HTTP/2.0","HTTP_UPGRADE_INSECURE_REQUESTS":"1","CONTENT_TYPE":"","DOCUMENT_ROOT":"/srv/docs-publisher/public","SSL_PROTOCOL":"TLSv1.3","HTTP_SEC_FETCH_USER":"?1","HTTP_TE":"trailers","HTTP_X_FORWARDED_HOST":"localhost"},"dial":"/var/run/php/php-fpm.sock","env":{"SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_SEC_FETCH_MODE":"navigate","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","CONTENT_LENGTH":"","SERVER_SOFTWARE":"Caddy/v2.6.2","HTTP_HOST":"localhost","SCRIPT_NAME":"/index.php","SERVER_PORT":"443","HTTP_SEC_FETCH_DEST":"document","HTTP_SEC_FETCH_SITE":"none","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","QUERY_STRING":"","REMOTE_ADDR":"172.19.0.1","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php","SERVER_NAME":"localhost","DOCUMENT_URI":"/index.php","HTTPS":"on","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_ACCEPT":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","REMOTE_IDENT":"","PATH_INFO":"","REMOTE_PORT":"38916","HTTP_X_FORWARDED_PROTO":"https","REMOTE_USER":"","SERVER_PROTOCOL":"HTTP/2.0","HTTP_UPGRADE_INSECURE_REQUESTS":"1","CONTENT_TYPE":"","HTTP_TE":"trailers","HTTP_X_FORWARDED_HOST":"localhost","DOCUMENT_ROOT":"/srv/docs-publisher/public","SSL_PROTOCOL":"TLSv1.3","HTTP_SEC_FETCH_USER":"?1","HTTP_X_FORWARDED_FOR":"172.19.0.1","GATEWAY_INTERFACE":"CGI/1.1","REMOTE_HOST":"172.19.0.1","REQUEST_URI":"/handbook/en/latest/","AUTH_TYPE":"","REQUEST_METHOD":"GET","REQUEST_SCHEME":"https"},"request":{"remote_ip":"172.19.0.1","remote_port":"38916","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Te":["trailers"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-User":["?1"],"X-Forwarded-Host":["localhost"],"X-Forwarded-Proto":["https"],"Sec-Fetch-Site":["none"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"X-Forwarded-For":["172.19.0.1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}}}
2022-12-22 01:37:34 {"level":"debug","ts":1671673054.952619,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.097437531,"request":{"remote_ip":"172.19.0.1","remote_port":"38916","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Sec-Fetch-Site":["none"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-User":["?1"],"Te":["trailers"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"X-Forwarded-Host":["localhost"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"Status":["404 Not Found"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception":["Sorry%2C%20the%20book%20you%20requested%20does%20not%20exist.%20Please%20check%20the%20URL%20and%20try%20again%21"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FEventSubscriber%2FExceptionSubscriber.php:31"]},"status":404}
2022-12-22 01:37:34 {"level":"error","ts":1671673054.954661,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"38916","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/handbook/en/latest/","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.101535326,"size":18531,"status":404,"resp_headers":{"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Status":["404 Not Found"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception":["Sorry%2C%20the%20book%20you%20requested%20does%20not%20exist.%20Please%20check%20the%20URL%20and%20try%20again%21"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FEventSubscriber%2FExceptionSubscriber.php:31"],"Content-Encoding":["gzip"],"Vary":["Accept-Encoding"]}}

Are you sure that /handbook/en/latest/index.html exists?

The fact it rewrote to /index.php tells me that it fell through to the last part of the try_files, to index.php.

1 Like

So it turns out that the Handbook path didn’t build properly.

But other paths are not redirecting either without the trailing / no CSS or images load.

** Logging with trailing / **

2022-12-22 09:04:33 {"level":"debug","ts":1671699873.0550857,"logger":"http.handlers.rewrite","msg":"rewrote request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/latest/","headers":{"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"If-Modified-Since":["Tue, 08 Feb 2022 19:44:14 GMT"],"If-None-Match":["\"r7045q1en9\""],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Dest":["document"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"method":"GET","uri":"/user/en/latest/index.html"}
2022-12-22 09:04:33 {"level":"debug","ts":1671699873.0553014,"logger":"http.handlers.file_server","msg":"sanitized path join","site_root":"/srv/docs-publisher/public","request_path":"/user/en/latest/index.html","result":"/srv/docs-publisher/public/user/en/latest/index.html"}
2022-12-22 09:04:33 {"level":"debug","ts":1671699873.0567298,"logger":"http.handlers.file_server","msg":"opening file","filename":"/srv/docs-publisher/public/user/en/latest/index.html"}
2022-12-22 09:04:33 {"level":"info","ts":1671699873.0985131,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/latest/","headers":{"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"If-None-Match":["\"r7045q1en9\""],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Dest":["document"],"If-Modified-Since":["Tue, 08 Feb 2022 19:44:14 GMT"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.0509148,"size":0,"status":304,"resp_headers":{"Etag":["\"r7045q1en9\""],"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"]}}

**Logging without trailing / **

2022-12-22 09:06:28 {"level":"debug","ts":1671699988.8789616,"logger":"http.handlers.rewrite","msg":"rewrote request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/stylesheets/extra.css","headers":{"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/css,*/*;q=0.1"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"method":"GET","uri":"/index.php"}
2022-12-22 09:06:28 {"level":"debug","ts":1671699988.879002,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"/var/run/php/php-fpm.sock","total_upstreams":1}
2022-12-22 09:06:28 {"level":"debug","ts":1671699988.8791125,"logger":"http.reverse_proxy.transport.fastcgi","msg":"roundtrip","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Accept-Encoding":["gzip, deflate, br"],"X-Forwarded-Host":["localhost"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/css,*/*;q=0.1"],"Te":["trailers"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"env":{"PATH_INFO":"","SCRIPT_NAME":"/index.php","SERVER_PORT":"443","HTTPS":"on","SSL_PROTOCOL":"TLSv1.3","HTTP_SEC_FETCH_DEST":"style","QUERY_STRING":"","DOCUMENT_ROOT":"/srv/docs-publisher/public","HTTP_HOST":"localhost","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","AUTH_TYPE":"","REQUEST_URI":"/user/en/assets/stylesheets/extra.css","HTTP_TE":"trailers","SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_REFERER":"https://localhost/user/en/latest","HTTP_SEC_FETCH_MODE":"no-cors","REMOTE_HOST":"172.19.0.1","REMOTE_PORT":"50578","REMOTE_USER":"","REQUEST_SCHEME":"https","HTTP_X_FORWARDED_FOR":"172.19.0.1","GATEWAY_INTERFACE":"CGI/1.1","REMOTE_IDENT":"","CONTENT_TYPE":"","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_SEC_FETCH_SITE":"same-origin","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_X_FORWARDED_HOST":"localhost","HTTP_X_FORWARDED_PROTO":"https","CONTENT_LENGTH":"","REQUEST_METHOD":"GET","SERVER_SOFTWARE":"Caddy/v2.6.2","DOCUMENT_URI":"/index.php","HTTP_ACCEPT":"text/css,*/*;q=0.1","REMOTE_ADDR":"172.19.0.1","SERVER_NAME":"localhost","SERVER_PROTOCOL":"HTTP/2.0"},"dial":"/var/run/php/php-fpm.sock","env":{"REMOTE_USER":"","REQUEST_SCHEME":"https","HTTP_X_FORWARDED_FOR":"172.19.0.1","GATEWAY_INTERFACE":"CGI/1.1","REMOTE_IDENT":"","CONTENT_TYPE":"","REMOTE_HOST":"172.19.0.1","REMOTE_PORT":"50578","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_SEC_FETCH_SITE":"same-origin","HTTP_X_FORWARDED_PROTO":"https","CONTENT_LENGTH":"","REQUEST_METHOD":"GET","SERVER_SOFTWARE":"Caddy/v2.6.2","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_X_FORWARDED_HOST":"localhost","REMOTE_ADDR":"172.19.0.1","SERVER_NAME":"localhost","SERVER_PROTOCOL":"HTTP/2.0","DOCUMENT_URI":"/index.php","HTTP_ACCEPT":"text/css,*/*;q=0.1","PATH_INFO":"","HTTPS":"on","SSL_PROTOCOL":"TLSv1.3","HTTP_SEC_FETCH_DEST":"style","QUERY_STRING":"","DOCUMENT_ROOT":"/srv/docs-publisher/public","HTTP_HOST":"localhost","SCRIPT_NAME":"/index.php","SERVER_PORT":"443","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","AUTH_TYPE":"","REQUEST_URI":"/user/en/assets/stylesheets/extra.css","SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_REFERER":"https://localhost/user/en/latest","HTTP_SEC_FETCH_MODE":"no-cors","HTTP_TE":"trailers"},"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/css,*/*;q=0.1"],"Te":["trailers"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Accept-Encoding":["gzip, deflate, br"],"X-Forwarded-Host":["localhost"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}}}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.2510328,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.37722974,"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Dest":["script"],"X-Forwarded-For":["172.19.0.1"],"Te":["trailers"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Mode":["no-cors"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Site":["same-origin"],"X-Forwarded-Proto":["https"],"X-Forwarded-Host":["localhost"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"Cache-Control":["no-cache, private"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token":["625384"],"Status":["500 Internal Server Error"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Token-Link":["https://localhost/_profiler/625384"],"X-Previous-Debug-Token":["aa6f6d"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"]},"status":500}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.2510822,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.377456386,"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Sec-Fetch-Dest":["style"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"X-Forwarded-Proto":["https"],"X-Forwarded-Host":["localhost"],"Accept":["text/css,*/*;q=0.1"],"Sec-Fetch-Mode":["no-cors"],"Sec-Fetch-Site":["same-origin"],"Referer":["https://localhost/user/en/latest"],"X-Forwarded-For":["172.19.0.1"],"Te":["trailers"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"],"X-Debug-Token":["5e9842"],"X-Previous-Debug-Token":["1b3b75"],"Status":["500 Internal Server Error"],"Content-Type":["text/html; charset=UTF-8"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token-Link":["https://localhost/_profiler/5e9842"]},"status":500}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.2510324,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.37688415,"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"X-Forwarded-Host":["localhost"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"Accept-Encoding":["gzip, deflate, br"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Te":["trailers"],"Sec-Fetch-Mode":["no-cors"],"Accept":["text/css,*/*;q=0.1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token-Link":["https://localhost/_profiler/5438eb"],"X-Debug-Token":["5438eb"],"X-Previous-Debug-Token":["d7864e"],"Status":["500 Internal Server Error"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"]},"status":500}
2022-12-22 09:06:29 {"level":"error","ts":1671699989.3018246,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/stylesheets/palette.e6a45f82.min.css","headers":{"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept-Language":["en-GB,en;q=0.5"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Te":["trailers"],"Accept":["text/css,*/*;q=0.1"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Mode":["no-cors"],"Sec-Fetch-Site":["same-origin"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.429209446,"size":44279,"status":500,"resp_headers":{"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"],"X-Previous-Debug-Token":["d7864e"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token-Link":["https://localhost/_profiler/5438eb"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Token":["5438eb"],"Content-Encoding":["gzip"],"Vary":["Accept-Encoding"],"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Status":["500 Internal Server Error"]}}
2022-12-22 09:06:29 {"level":"error","ts":1671699989.3017948,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/stylesheets/main.6e60f8b8.min.css","headers":{"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Accept":["text/css,*/*;q=0.1"],"Sec-Fetch-Mode":["no-cors"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.432876447,"size":44287,"status":500,"resp_headers":{"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Previous-Debug-Token":["1b3b75"],"Vary":["Accept-Encoding"],"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Cache-Control":["no-cache, private"],"X-Debug-Token":["5e9842"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Token-Link":["https://localhost/_profiler/5e9842"],"Status":["500 Internal Server Error"],"Content-Encoding":["gzip"]}}
2022-12-22 09:06:29 {"level":"error","ts":1671699989.3034933,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/javascripts/bundle.960e086b.min.js","headers":{"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Sec-Fetch-Dest":["script"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Mode":["no-cors"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.434602378,"size":44286,"status":500,"resp_headers":{"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"X-Debug-Token-Link":["https://localhost/_profiler/625384"],"X-Previous-Debug-Token":["aa6f6d"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"Cache-Control":["no-cache, private"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"Server":["Caddy"],"Content-Type":["text/html; charset=UTF-8"],"Vary":["Accept-Encoding"],"X-Debug-Token":["625384"],"Content-Encoding":["gzip"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Status":["500 Internal Server Error"]}}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.3622124,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.483121803,"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Accept-Encoding":["gzip, deflate, br"],"X-Forwarded-Host":["localhost"],"Sec-Fetch-Site":["same-origin"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/css,*/*;q=0.1"],"Te":["trailers"],"Accept-Language":["en-GB,en;q=0.5"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"],"X-Debug-Token-Link":["https://localhost/_profiler/2c0608"],"X-Previous-Debug-Token":["4aa033"],"Status":["500 Internal Server Error"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token":["2c0608"]},"status":500}
2022-12-22 09:06:29 {"level":"error","ts":1671699989.380911,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/stylesheets/extra.css","headers":{"Te":["trailers"],"Accept-Language":["en-GB,en;q=0.5"],"Sec-Fetch-Site":["same-origin"],"Accept-Encoding":["gzip, deflate, br"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Dest":["style"],"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Accept":["text/css,*/*;q=0.1"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.508485256,"size":44009,"status":500,"resp_headers":{"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Previous-Debug-Token":["4aa033"],"X-Debug-Token-Link":["https://localhost/_profiler/2c0608"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Token":["2c0608"],"Status":["500 Internal Server Error"],"Content-Encoding":["gzip"],"Server":["Caddy"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"],"Vary":["Accept-Encoding"]}}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.3916082,"logger":"http.handlers.rewrite","msg":"rewrote request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/javascripts/bundle.960e086b.min.js","headers":{"Sec-Fetch-Site":["same-origin"],"Te":["trailers"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["script"],"Accept-Encoding":["gzip, deflate, br"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Mode":["no-cors"],"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"method":"GET","uri":"/index.php"}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.3916545,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"/var/run/php/php-fpm.sock","total_upstreams":1}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.3917518,"logger":"http.reverse_proxy.transport.fastcgi","msg":"roundtrip","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Te":["trailers"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["script"],"X-Forwarded-Host":["localhost"],"Sec-Fetch-Mode":["no-cors"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Site":["same-origin"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"env":{"REQUEST_SCHEME":"https","SCRIPT_NAME":"/index.php","HTTPS":"on","SSL_PROTOCOL":"TLSv1.3","SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_SEC_FETCH_SITE":"same-origin","AUTH_TYPE":"","PATH_INFO":"","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_ACCEPT":"*/*","SERVER_SOFTWARE":"Caddy/v2.6.2","DOCUMENT_ROOT":"/srv/docs-publisher/public","CONTENT_TYPE":"","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php","REMOTE_USER":"","SERVER_PROTOCOL":"HTTP/2.0","HTTP_HOST":"localhost","REQUEST_URI":"/user/en/assets/javascripts/bundle.960e086b.min.js","HTTP_REFERER":"https://localhost/user/en/latest","CONTENT_LENGTH":"","REMOTE_PORT":"50578","SERVER_PORT":"443","HTTP_X_FORWARDED_HOST":"localhost","REQUEST_METHOD":"GET","DOCUMENT_URI":"/index.php","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","REMOTE_ADDR":"172.19.0.1","REMOTE_HOST":"172.19.0.1","HTTP_X_FORWARDED_FOR":"172.19.0.1","HTTP_SEC_FETCH_MODE":"no-cors","REMOTE_IDENT":"","QUERY_STRING":"","HTTP_SEC_FETCH_DEST":"script","HTTP_TE":"trailers","HTTP_X_FORWARDED_PROTO":"https","GATEWAY_INTERFACE":"CGI/1.1","SERVER_NAME":"localhost"},"dial":"/var/run/php/php-fpm.sock","env":{"HTTP_HOST":"localhost","REQUEST_URI":"/user/en/assets/javascripts/bundle.960e086b.min.js","HTTP_REFERER":"https://localhost/user/en/latest","CONTENT_LENGTH":"","REMOTE_PORT":"50578","REMOTE_USER":"","SERVER_PROTOCOL":"HTTP/2.0","REQUEST_METHOD":"GET","DOCUMENT_URI":"/index.php","SERVER_PORT":"443","HTTP_X_FORWARDED_HOST":"localhost","REMOTE_ADDR":"172.19.0.1","REMOTE_HOST":"172.19.0.1","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_USER_AGENT":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","REMOTE_IDENT":"","QUERY_STRING":"","HTTP_X_FORWARDED_FOR":"172.19.0.1","HTTP_SEC_FETCH_MODE":"no-cors","HTTP_X_FORWARDED_PROTO":"https","GATEWAY_INTERFACE":"CGI/1.1","SERVER_NAME":"localhost","HTTP_SEC_FETCH_DEST":"script","HTTP_TE":"trailers","HTTPS":"on","SSL_PROTOCOL":"TLSv1.3","SSL_CIPHER":"TLS_AES_128_GCM_SHA256","HTTP_SEC_FETCH_SITE":"same-origin","AUTH_TYPE":"","PATH_INFO":"","REQUEST_SCHEME":"https","SCRIPT_NAME":"/index.php","SERVER_SOFTWARE":"Caddy/v2.6.2","DOCUMENT_ROOT":"/srv/docs-publisher/public","HTTP_ACCEPT_LANGUAGE":"en-GB,en;q=0.5","HTTP_ACCEPT":"*/*","CONTENT_TYPE":"","SCRIPT_FILENAME":"/srv/docs-publisher/public/index.php"},"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-Mode":["no-cors"],"Referer":["https://localhost/user/en/latest"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["script"],"Te":["trailers"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"X-Forwarded-Host":["localhost"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}}}
2022-12-22 09:06:29 {"level":"debug","ts":1671699989.4561288,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"unix//var/run/php/php-fpm.sock","duration":0.064432766,"request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/index.php","headers":{"Sec-Fetch-Mode":["no-cors"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"],"X-Forwarded-For":["172.19.0.1"],"X-Forwarded-Proto":["https"],"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["script"],"X-Forwarded-Host":["localhost"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"headers":{"Cache-Control":["no-cache, private"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token":["e37ba8"],"X-Debug-Token-Link":["https://localhost/_profiler/e37ba8"],"Status":["500 Internal Server Error"],"Content-Type":["text/html; charset=UTF-8"],"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"X-Previous-Debug-Token":["4c2d1f"]},"status":500}
2022-12-22 09:06:29 {"level":"error","ts":1671699989.4744017,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"50578","proto":"HTTP/2.0","method":"GET","host":"localhost","uri":"/user/en/assets/javascripts/bundle.960e086b.min.js","headers":{"Accept":["*/*"],"Accept-Language":["en-GB,en;q=0.5"],"Accept-Encoding":["gzip, deflate, br"],"Referer":["https://localhost/user/en/latest"],"Sec-Fetch-Mode":["no-cors"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"],"Sec-Fetch-Dest":["script"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"localhost"}},"user_id":"","duration":0.088760343,"size":44023,"status":500,"resp_headers":{"X-Debug-Exception":["App%5CModel%5CLanguage%3A%3AgetVersionByDescriptor%28%29%3A%20Return%20value%20must%20be%20of%20type%20App%5CModel%5CVersion%2C%20null%20returned"],"X-Debug-Exception-File":["%2Fsrv%2Fdocs-publisher%2Fsrc%2FModel%2FLanguage.php:242"],"Cache-Control":["no-cache, private"],"X-Debug-Token":["e37ba8"],"X-Previous-Debug-Token":["4c2d1f"],"Vary":["Accept-Encoding"],"Server":["Caddy"],"Alt-Svc":["h3=\":443\"; ma=2592000"],"Status":["500 Internal Server Error"],"Content-Type":["text/html; charset=UTF-8"],"Date":["Thu, 22 Dec 2022 09:06:29 GMT"],"X-Debug-Token-Link":["https://localhost/_profiler/e37ba8"],"Content-Encoding":["gzip"]}}
2022-12-22 09:06:42 {"level":"debug","ts":1671700002.5153644,"logger":"events","msg":"event","name":"tls_get_certificate","id":"b1d79b49-85aa-4724-b7a7-cefcfaac2c5e","origin":"tls","data":{"client_hello":{"CipherSuites":[4866,4865,49196,49195,49200,49199,49188,49187,49192,49191,49162,49161,49172,49171,157,156,61,60,53,47],"ServerName":"cloudflare-dns.com","SupportedCurves":[29,23,24],"SupportedPoints":null,"SignatureSchemes":[2052,2053,2054,1025,1281,513,1027,1283,515,514,1537,1539],"SupportedProtos":["h2","http/1.1"],"SupportedVersions":[772,771],"Conn":{}}}}
1 Like

Are you absolutely sure that stylesheet file exists? I see no reason it would rewrite to /index.php unless the {path} part of try_files did not find a file on disk.

I don’t understand what’s going on with your first request. Could you show what happens with curl -v? It’s not making sense to me.

1 Like

The path to the stylesheet should be /user/en/latest/stylesheets/extra.css but without the trailing / it’s not getting the correct relative root for it’s path - the same for image files. Interestingly and I’m genuinely not sure why but it’s now working correctly and redirecting appropriately. from paths without a trailing / to the path with.

So this is resolved?

This topic was automatically closed after 30 days. New replies are no longer allowed.