Nginx 安装
yum install -y epel-release
yum –y install Nginx
新建文件 vim /etc/conf.d/xxxxx.conf
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name demo.com; ssl_certificate /etc/letsencrypt/live/demo.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/demo.com/privkey.pem; proxy_redirect off; proxy_http_version 1.1; proxy_cache_bypass $http_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; 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 X-Forwarded-Host $server_name; location / { root /var/www/demo; index index.html index.htm; } # Configure the SignalR Endpoint location /api/ { proxy_pass http://localhost:8800/; } } server { listen 80; server_name demo.com; return 301 https://$server_name$request_uri; }