fix: standardize pod nginx to root and enable ingress rewrite-target

This commit is contained in:
2026-09-04 09:10:51 +07:00
parent f06a8fc205
commit 97bd62fd47
2 changed files with 10 additions and 16 deletions
+3 -10
View File
@@ -57,16 +57,12 @@ RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache
# Konfigurasi Nginx presisi untuk subpath /sidata dan PHP-FPM
# Konfigurasi Nginx Standar Laravel (Merespons di Root /)
RUN echo 'server { \
listen 80; \
index index.php index.html; \
root /var/www/html/public; \
\
location /sidata { \
try_files $uri $uri/ /sidata/index.php?$query_string; \
} \
\
location / { \
try_files $uri $uri/ /index.php?$query_string; \
} \
@@ -75,14 +71,11 @@ RUN echo 'server { \
fastcgi_pass 127.0.0.1:9000; \
fastcgi_index index.php; \
include fastcgi_params; \
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; \
fastcgi_param SCRIPT_NAME $fastcgi_script_name; \
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \
} \
}' > /etc/nginx/sites-available/default
# ... (bagian atas Dockerfile tetap sama) ...
EXPOSE 80
# Script startup: Buat .env dari variabel environment Helm jika .env belum ada, lalu jalankan service
# Script startup: Buat .env dari variabel environment Helm, lalu jalankan service
CMD ["sh", "-c", "env | grep -E '^(APP_|DB_|MYSQL_|ORA_|REDIS_|MAIL_|SESSION_|SOA_)' > /var/www/html/.env && redis-server --daemonize yes && php-fpm -D && exec nginx -g 'daemon off;'"]