nginx設定(R640)
1. 有効な設定ファイル一覧(/etc/nginx/sites-enabled/)
| ファイル | 用途 |
|---|---|
| cloud.k2-o.net | Nextcloud(IP制限あり)+ 運営ポータル /ui + 顧客 /client |
| office.wan-secure.net | Collabora → 172.31.22.2:9980 |
| admin.wan-secure.net | 管理画面 |
| nextcloud.vpn | VPN内部用 |
| portal.vpn | ポータル内部用 |
2. cloud.k2-o.net の許可IP(Nextcloud location /)
allow 192.168.20.0/24; # LAN allow 192.168.10.0/24; # MGMT allow 10.251.0.0/24; # 旧wg1(互換性のため残存) allow 10.200.0.0/16; # wg0(顧客・管理用)★現在運用中 allow 10.250.0.0/24; # wg2(VPS) allow 172.31.22.0/24; # Fabric(旧・Collabora用) allow 173.0.0.0/29; # Fabric新メッシュ allow 127.0.0.1; deny all;
3. SSL証明書(Let’s Encrypt)
| ドメイン | 有効期限 |
|---|---|
| cloud.k2-o.net | 2026-06-12 |
| office.wan-secure.net | 2026-06-23 |
証明書は certbot により自動更新されます。
4. nginx設定例(cloud.k2-o.net)
server {
listen 80;
server_name cloud.k2-o.net;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name cloud.k2-o.net;
ssl_certificate /etc/letsencrypt/live/cloud.k2-o.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cloud.k2-o.net/privkey.pem;
client_max_body_size 10G;
# 運営ポータル(IP制限)
location /ui {
allow 192.168.20.0/24;
allow 10.251.0.0/24;
allow 10.200.0.0/16;
allow 10.250.0.0/24;
allow 127.0.0.1;
deny all;
proxy_pass http://127.0.0.1:9000;
...
}
# 顧客ポータル(全許可)
location /client {
proxy_pass http://127.0.0.1:9000;
...
}
# Nextcloud(IP制限)
location / {
allow 192.168.20.0/24;
allow 192.168.10.0/24;
allow 10.251.0.0/24;
allow 10.200.0.0/16;
allow 10.250.0.0/24;
allow 172.31.22.0/24;
allow 173.0.0.0/29;
allow 127.0.0.1;
deny all;
proxy_pass http://127.0.0.1:9080;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port 443;
...
}
}