You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GlucoWise/nginx-basic.conf

32 lines
797 B

server {
listen 80;
server_name 1.92.111.107;
# 前端静态文件
location / {
root /var/www/glucowise;
index index.html;
try_files $uri $uri/ /index.html;
}
# API代理到后端
location /api/ {
proxy_pass http://localhost:8080;
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_connect_timeout 30s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
}
# 上传文件访问
location /uploads/ {
alias /opt/glucowise/uploads/;
expires 1y;
add_header Cache-Control "public";
}
}