加一段这个配置
location /{ index index.html; error_page 404 /index.html; }
完整的参考下面这段
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)
- 热议问题
-
物联网平台采集的数据做WebSocket 这种推送从哪里介入比较好
1
-
【组态】绑定设备,并设置过滤后,点击【请求数据】,结果是空。
1
-
新拉取的 blade-boot版本前端是那个
1
-
物联网平台有封装HTTP请求的工具类吗
1
-
大屏的列表组件怎么能获得点击某一项的数据库
1
-
项目启动报错,nacos为3.0.1版本。
1
-
物联网系统,设备动态注册,相同uniqueNo 注册多次 写入多次入库,缓存导致的问题
1
-
minio上传地址修改错误
1
-
Knife4j访问文档页面(http://localhost/doc.html)异常!
1
-
install了4.0.1的tool,依赖还是不存在
1
扫一扫访问 Blade技术社区 移动端