このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 02 Apache2で自己認証ssl [中間証明書の整合性確認]
最近の更新
こちらの方が便利かも25 Let's Encrypt リバースプロキシ
この設定で下記のように表示されます。
hogehoge.com → reverse.com
hogehoge2.com → reverse2.com
hogehoge3.com → reverse3.com
docker-compose.yml
version: '3.3' services: nginx-proxy: image: jwilder/nginx-proxy labels: - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true ports: # nesessary port 80 for Let's Encrypt - 80:80 - 443:443 volumes: - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - /var/run/docker.sock:/tmp/docker.sock:ro - ./certs:/etc/nginx/certs:ro - ./nginx-proxy/custom.conf:/etc/nginx/conf.d/custom.conf:ro restart: always letsencrypt: image: jrcs/letsencrypt-nginx-proxy-companion volumes: - vhost:/etc/nginx/vhost.d - html:/usr/share/nginx/html - /var/run/docker.sock:/var/run/docker.sock:ro - ./certs:/etc/nginx/certs:rw restart: always bridge-1: image: nginx:latest volumes: - ./bridge-1/default.conf:/etc/nginx/conf.d/default.conf - ./bridge-1:/var/www/html environment: - VIRTUAL_PORT=80 - VIRTUAL_HOST=hogehoge.com, hogehoge2.com, hogehoge3.com - LETSENCRYPT_HOST=hogehoge.com, hogehoge2.com, hogehoge3.com - LETSENCRYPT_EMAIL=info@kumolabo.com restart: always volumes: vhost: html:
mkdir ./nginx-proxy/ touch ./nginx-proxy/custom.conf mkdir ./bridge-1/
./bridge-1/default.conf
server { listen 80; server_name hogehoge.com; location / { proxy_request_buffering off; proxy_pass http://reverse.com/; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; server_name hogehoge2.com; location / { proxy_request_buffering off; proxy_pass http://reverse2.com/; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { listen 80; server_name hogehoge3.com; location / { proxy_request_buffering off; proxy_pass http://reverse3.com/; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
下記2つのファイルにclient_max_body_sizeを追加する。
echo 'client_max_body_size 1g;' >> ./nginx-proxy/custom.conf
vi ./bridge-1/default.conf
client_max_body_size 1g;
server {
listen 80;
server_name hogehoge.com;
location / {
proxy_request_buffering off;
proxy_pass http://reverse.com/;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}