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

27 lines
714 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

server {
listen 80;
server_name glucowise.site www.glucowise.site;
root /var/www/glucowise;
index index.html;
# Let's Encrypt验证目录
location /.well-known/acme-challenge/ {
root /var/www/glucowise;
allow all;
}
# 临时允许HTTP访问申请证书后会重定向到HTTPS
location / {
try_files $uri $uri/ /index.html;
}
# 后端API代理
location /api/ {
proxy_pass http://127.0.0.1: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;
}
}