Commit 16bd5924 authored by nanahira's avatar nanahira

new

parent fd729fb3
version: '2.4'
services:
cloudflared:
restart: always
image: cloudflare/cloudflared:latest
command: '{{cloudflared_command}}'
nginx:
restart: always
image: git-registry.moenext.com/nanahira/nginx-proxy
volumes:
- ./sites:/data/sites:ro
- ./templates/unversal.conf:/etc/nginx/conf.d/universal.conf:ro
- /etc/localtime:/etc/localtime:ro
- ./cache:/etc/nginx/cache
environment:
REAL_IP: 172.16.0.0/12
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
# 每个域名对应一个目录 /data/sites/<host>
# 比如 Host: foo.example.com -> /data/sites/foo.example.com
set $site_root /data/sites/$host;
root $site_root;
index index.html;
location / {
# 先找真实文件 -> 目录 -> index.html
# 文件不存在就统一用 index.html(SPA 友好)
try_files $uri $uri/ /index.html;
# 缓存 1 小时
expires 1h;
add_header Cache-Control "public, max-age=3600";
}
# 可选:关掉目录列表
autoindex off;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment