-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnginx.conf
More file actions
executable file
·48 lines (44 loc) · 1.95 KB
/
nginx.conf
File metadata and controls
executable file
·48 lines (44 loc) · 1.95 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
# Optional: use this as custom config if you need to override default nginx behavior.
# Copy into image as /etc/nginx/conf.d/default.conf or replace default.conf.
# When deployed in K8s next to rustfs-operator-console, /api is proxied so same-origin /api/v1 works.
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Proxy /api to Console backend (in-cluster: rustfs-operator-console:9090). Enables default
# apiBaseUrl "/api/v1" so frontend works without NEXT_PUBLIC_API_BASE_URL or ?apiBaseUrl=.
location /api/ {
proxy_pass http://rustfs-operator-console:9090;
proxy_http_version 1.1;
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 Swagger UI and OpenAPI docs to Console backend
location /swagger-ui {
proxy_pass http://rustfs-operator-console:9090;
proxy_http_version 1.1;
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;
}
location /api-docs/ {
proxy_pass http://rustfs-operator-console:9090;
proxy_http_version 1.1;
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;
}
# Prefer $uri.html so /cluster serves cluster.html without 301 to /cluster/ (trailing slash
# can break Next.js client router and asset paths). Fallback to directory then SPA index.
location / {
try_files $uri $uri.html $uri/ /index.html;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
}