43 lines
1.2 KiB
Nginx Configuration File
43 lines
1.2 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
client_max_body_size 10M;
|
|
|
|
# 1. Landing Page Utama
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# 2. Route ke Poverty Mapping App
|
|
location /poverty-mapping/ {
|
|
proxy_pass http://poverty-mapping:80/;
|
|
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;
|
|
|
|
# Scope cookies ke subpath agar tidak tabrakan session PHP-nya
|
|
proxy_cookie_path / /poverty-mapping/;
|
|
}
|
|
|
|
# 3. Route ke Tugas SPBU App
|
|
location /tugas-spbu/ {
|
|
proxy_pass http://tugas-spbu:80/;
|
|
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;
|
|
|
|
proxy_cookie_path / /tugas-spbu/;
|
|
}
|
|
|
|
# Block access to hidden files (.env, .git, etc.)
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|