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.

59 lines
1.8 KiB

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.

# 查价中台 — Nginx 站点配置HTTPS
# 安装bash deploy/install.sh --nginx
# 或手动:
# sudo cp deploy/nginx/chajia.conf /etc/nginx/sites-available/chajia
# sudo ln -sf /etc/nginx/sites-available/chajia /etc/nginx/sites-enabled/chajia
# sudo nginx -t && sudo systemctl reload nginx
#
# 将 __PUBLIC_DOMAIN__ 替换为你的域名install.sh 会自动替换)
# HTTP → HTTPS 重定向
server {
listen 80;
listen [::]:80;
server_name __PUBLIC_DOMAIN__;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name __PUBLIC_DOMAIN__;
# 【请填写】Let's Encrypt 证书路径certbot 签发后自动生成)
ssl_certificate /etc/letsencrypt/live/__PUBLIC_DOMAIN__/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/__PUBLIC_DOMAIN__/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 2m;
# 地址联想 API 最长 300s询价轮询由客户端完成
proxy_connect_timeout 60s;
proxy_send_timeout 320s;
proxy_read_timeout 320s;
location / {
proxy_pass http://127.0.0.1:__APP_PORT__;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
}
access_log /var/log/nginx/chajia-access.log;
error_log /var/log/nginx/chajia-error.log;
}