nginx部署无法加载响应数据

Blade 未结 1 54
bl
bl 剑圣 2025-05-08 14:21

一、该问题的重现步骤是什么?

1. nginx部署前端saber3,访问登录无法加载响应数据如何解决

2. nginx配置文件需要设置哪些参数

3.


二、你期待的结果是什么?实际看到的又是什么?

wufa加载.JPG

三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

1条回答
  • 2025-05-08 15:38

    完整的参考下面这段

    user  root;
    worker_processes  1;
    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;
    events {
        worker_connections  1024;
    }
    http {
        include       /etc/nginx/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  /var/log/nginx/access.log  main;
        sendfile        on;
        #tcp_nopush     on;
        keepalive_timeout  65;
        #gzip  on;
        #include /etc/nginx/conf.d/*.conf;
        upstream gateway {
                     server blade-api;
                 }
        server {
          listen       2888;
          server_name  web;
          root         /usr/share/nginx/html;
          gzip on;
          gzip_min_length  1k;
          gzip_buffers     4 16k;
          gzip_http_version 1.1;
          gzip_comp_level 2;
          gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
          gzip_vary on;
          gzip_proxied   expired no-cache no-store private auth;
          gzip_disable   "MSIE [1-6]\.";
          location /{
               index index.html;
               error_page 404 /index.html;
          }
          location ~ ^/(api/)?actuator {
               return 403;
          }
          location ^~ /oauth/redirect {
               try_files $uri /index.html;
          }
          location ^~ /api/ {
               proxy_redirect   off;
               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_buffering off;
               rewrite ^/api/(.*)$ /$1 break;
               proxy_pass http://gateway/;
          }
        }
    }



    0 讨论(0)
代码语言
提交回复