diff --git a/.env.example b/.env.example index 027016a..d4c4424 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,10 @@ APP_NAME=Laravel -APP_ENV=local +APP_ENV=production APP_KEY= -APP_DEBUG=true +APP_DEBUG=false APP_TIMEZONE=Asia/Taipei -APP_URL=https://KTVCentral.test -L5_SWAGGER_CONST_HOST=https://KTVCentral.test/ +APP_URL=http://ctl1.superstar.dnsnet.cc +L5_SWAGGER_CONST_HOST=http://ctl1.superstar.dnsnet.cc APP_LOCALE=zh-tw APP_FALLBACK_LOCALE=zh-tw @@ -25,7 +25,7 @@ LOG_LEVEL=debug #DB_CONNECTION=sqlite DB_CONNECTION=mariadb DB_HOST=127.0.0.1 -DB_PORT=3307 +DB_PORT=3306 DB_DATABASE=Karaoke-Kingpin_Central DB_USERNAME=Karaoke-Kingpin DB_PASSWORD=ESM7yTPMnavFmbBH diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 4828850..eba925f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -22,6 +22,9 @@ class AppServiceProvider extends ServiceProvider */ public function boot(): void { + if (app()->environment('production')) { + config(['app.url' => request()->getSchemeAndHttpHost()]); + } Room::observe(RoomObserver::class); } } diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 21f5b47..65af11f 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -1,10 +1,14 @@ server { - listen 80; - server_name ktvcentral.localhost; - root /var/www/html/public; + listen 80 default_server; + server_name _; # 接收所有主機名稱的請求 + root /var/www/html/public; index index.php index.html; + # 設定 log 檔案方便除錯(可選) + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + location / { try_files $uri $uri/ /index.php?$query_string; } @@ -15,6 +19,7 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param APP_URL $http_host; # 將 host 傳給 Laravel 處理 } location ~ /\.ht { diff --git a/docker/supervisord.conf b/docker/supervisord.conf index d28b86b..255de64 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -20,9 +20,3 @@ command=cron -f autostart=true autorestart=true priority=3 - -[program:sqlite-sync] -command=php /var/www/html/artisan transfer:sqlite sqlite/tempUser.sqlite --sync -autostart=true -autorestart=false -priority=4 \ No newline at end of file