fix: resolution for nginx path routing, script_filename, and env fallback

This commit is contained in:
2026-09-04 08:51:01 +07:00
parent 97e5806526
commit 0935c718d6
+6 -3
View File
@@ -57,23 +57,26 @@ RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \ && chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache && chmod -R 775 /var/www/html/bootstrap/cache
# Konfigurasi Nginx untuk mendukung path / dan /sidata # Konfigurasi Nginx presisi untuk subpath /sidata dan PHP-FPM
RUN echo 'server { \ RUN echo 'server { \
listen 80; \ listen 80; \
index index.php index.html; \ index index.php index.html; \
root /var/www/html/public; \ root /var/www/html/public; \
\
location /sidata { \ location /sidata { \
alias /var/www/html/public; \
try_files $uri $uri/ /sidata/index.php?$query_string; \ try_files $uri $uri/ /sidata/index.php?$query_string; \
} \ } \
\
location / { \ location / { \
try_files $uri $uri/ /index.php?$query_string; \ try_files $uri $uri/ /index.php?$query_string; \
} \ } \
\
location ~ \.php$ { \ location ~ \.php$ { \
fastcgi_pass 127.0.0.1:9000; \ fastcgi_pass 127.0.0.1:9000; \
fastcgi_index index.php; \ fastcgi_index index.php; \
include fastcgi_params; \ include fastcgi_params; \
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \ fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; \
fastcgi_param SCRIPT_NAME $fastcgi_script_name; \
} \ } \
}' > /etc/nginx/sites-available/default }' > /etc/nginx/sites-available/default