サイドバー

このページの翻訳:



最近の更新



Tag Cloud

50_dialy:2021:04:29

文書の過去の版を表示しています。


2021.04.29 Docker dokuwiki

SSL付きのDokuwiki

https://docs.linuxserver.io/images/docker-dokuwiki

docker-compose.yml

---
version: "2.1"
services:
  https-portal:
    image: steveltn/https-portal:1
    ports:
      - '80:80'
      - '443:443'
    links:
      - dokuwiki
    #restart: always
    restart: unless-stopped
    environment:
      DOMAINS: 'dokuwiki.fl8.jp -> http://dokuwiki'
      #STAGE: 'local'
      STAGE: 'production'
      #FORCE_RENEW: 'true'
      
  dokuwiki:
    image: ghcr.io/linuxserver/dokuwiki
    container_name: dokuwiki
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Tokyo
    volumes:
      - ./config:/config
    #ports:
    #  - 80:80
    #  - 443:443 #optional
    restart: unless-stopped

X-Forwared-For

https-portalからforwardされてくるので、X-Forwared-Forからアクセス元IPを取得し、real_ipとしてセットする。

config/nginx/nginx.conf

	set_real_ip_from   172.18.0.0/16;
	real_ip_header     X-Forwarded-For;

FastCGI cache

config/nginx/nginx.conf

	fastcgi_cache_path /config/cache/nginx levels=1:2 keys_zone=cache-zone:30m max_size=2048M inactive=600m;
	fastcgi_cache_key "$scheme$request_method$host$request_uri";

config/nginx/site-confs/default

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # With php5-cgi alone:
        fastcgi_pass 127.0.0.1:9000;
        # With php5-fpm:
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;

	set $do_not_cache 0;

	#  -- POST or HEAD ?
	if ($request_method != "GET") {
		set $do_not_cache 1;
	}

        fastcgi_cache cache-zone;
        fastcgi_cache_valid 200 60m;
        add_header X-F-Cache $upstream_cache_status;
50_dialy/2021/04/29.1621401942.txt.gz · 最終更新: 2021/05/19 14:25 by matsui