Java后端
·2024-02-21请问各位。在设置https证书之后,前段中发送的http请求无响应,这个问题有解决方案么?
以下为我的nginx配置文件:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name fzoj.fun;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name fzoj.fun;
ssl_certificate /etc/letsencrypt/live/fzoj.fun/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fzoj.fun/privkey.pem;
root /data/webroot/dist;
index index.html index.htm;
try_files $uri $uri/index.html /index.html;
location /api {
proxy_pass http://127.0.0.1:8120;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_set_header Connection "";
}
}
}
6
0
分享
操作
评论
问答助学
相关内容
0个评论
全部评论
点击登录,快来和大家讨论吧~
表情
图片
暂无评论
