27 lines
632 B
Nginx Configuration File
27 lines
632 B
Nginx Configuration File
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
|
||
|
|
root /var/www/cbpoa;
|
||
|
|
index index.html;
|
||
|
|
|
||
|
|
# SPA fallback
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.html;
|
||
|
|
}
|
||
|
|
|
||
|
|
# Proxy API requests to backend
|
||
|
|
location /api/ {
|
||
|
|
proxy_pass http://127.0.0.1:8000/api/;
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
|
||
|
|
# Gzip
|
||
|
|
gzip on;
|
||
|
|
gzip_types text/plain text/css application/json application/javascript text/xml;
|
||
|
|
gzip_min_length 1000;
|
||
|
|
}
|