Files
webgis/nginx.conf
T
2026-06-11 17:43:01 +07:00

42 lines
1.1 KiB
Nginx Configuration File

server {
listen 80;
server_name localhost;
# 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;
}
}