-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathnginx.conf.complete
More file actions
86 lines (74 loc) · 2.86 KB
/
nginx.conf.complete
File metadata and controls
86 lines (74 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name 202.29.4.66 49.231.27.66 _;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
# ==================================================================
# TPMAP Household Dashboard
# ==================================================================
location /tpmap/ {
alias /var/www/project-tracking/tpmap_act/;
index household-dashboard.html indicators-selector.html index.html;
try_files $uri $uri/ =404;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Cache static files
location ~* \.(html|css|js|jpg|jpeg|png|gif|ico|svg)$ {
expires 7d;
add_header Cache-Control "public, must-revalidate";
}
}
# Redirect /tpmap to /tpmap/
location = /tpmap {
return 301 /tpmap/;
}
# ==================================================================
# Procurement System - API Proxy to Backend
# ==================================================================
location ^~ /procurement/api/ {
proxy_pass http://localhost:3000/api/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
}
# ==================================================================
# Procurement System - Frontend (React SPA)
# ==================================================================
# Requires symlink: ln -sf /var/www/OpenGISData-Thailand/procurement-system/client/dist /var/www/html/procurement
location /procurement/ {
try_files $uri $uri/ /procurement/index.html;
}
# Redirect /procurement to /procurement/
location = /procurement {
return 301 /procurement/;
}
# ==================================================================
# Default Location (Other Applications)
# ==================================================================
location / {
try_files $uri $uri/ =404;
}
# ==================================================================
# Security Settings
# ==================================================================
# Disable access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Disable access to backup files
location ~ ~$ {
deny all;
access_log off;
log_not_found off;
}
}