diff --git a/conf.d/frontend.dev.conf b/conf.d/frontend.dev.conf new file mode 100644 index 0000000..8e3282e --- /dev/null +++ b/conf.d/frontend.dev.conf @@ -0,0 +1,12 @@ + # ホスト名を変数経由にすると起動時の upstream 解決を避けられる(本番モード共存用) + location / { + set $vite_upstream frontend:5173; + proxy_pass http://$vite_upstream; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } diff --git a/conf.d/frontend.product.conf b/conf.d/frontend.product.conf new file mode 100644 index 0000000..fb65db9 --- /dev/null +++ b/conf.d/frontend.product.conf @@ -0,0 +1,5 @@ + location / { + root /var/www/html; + index index.html; + try_files $uri $uri/ /index.html; + }