Code Monkey home page Code Monkey logo

Comments (6)

hengfeiyang avatar hengfeiyang commented on May 24, 2024 1

try this:

        location /logs {
            return 302 /logs/;
        }

        location /logs/ {
            proxy_pass http://127.0.0.1:5080;
        }

You need remove the last slash in proxy_pass.

And set

ZO_BASE_URI = "/logs"

for OpenObserve.

from openobserve.

hengfeiyang avatar hengfeiyang commented on May 24, 2024 1

maybe you can delete this section:

  location ~* ^.+\.css$ {
    default_type text/css;
  }
  location ~* ^.+\.js$ {
    default_type text/javascript;
  }

default it should be no problem.

from openobserve.

miversen33 avatar miversen33 commented on May 24, 2024

I had tried several variations of the proxy_pass but could not get it to work. The ZO_BASE_URI is what I was missing.

Thank you!

from openobserve.

desprit avatar desprit commented on May 24, 2024

I have ZO_BASE_URI=/openobserve. And I have the following nginx config:

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  server_name _;
  proxy_max_temp_file_size 0;
  root /app/web/dist;

  location /api {
    proxy_pass http://0.0.0.0:8089;
    proxy_set_header Host $host;  
    proxy_set_header X-Real-IP $remote_addr;
  }
  location /openobserve {
    return 302 /openobserve/;
  }
  location /openobserve/ {
    proxy_pass http://0.0.0.0:5080;
    proxy_set_header Host $host;  
    proxy_set_header X-Real-IP $remote_addr;
  }
  location / {
    try_files $uri $uri/ /index.html;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
  }
  location ~* ^.+\.css$ {
    default_type text/css;
  }
  location ~* ^.+\.js$ {
    default_type text/javascript;
  }

  index index.html index.htm;

  access_log /dev/stdout;
}

Nginx error:

2023/08/15 06:40:17 [error] 7#7: *22 open() "/app/web/dist/openobserve/web/assets/index.05ee9c02.css" failed (2: No such file or directory)......."

How can I fix it?

from openobserve.

desprit avatar desprit commented on May 24, 2024

Solved by adding two additional locations:

location ~* /openobserve/web/assets/.+\.js$ {
    proxy_pass http://0.0.0.0:5080;
    proxy_set_header Host $host;  
    proxy_set_header X-Real-IP $remote_addr;
  }
  location ~* /openobserve/web/assets/.+\.css$ {
    proxy_pass http://0.0.0.0:5080;
    proxy_set_header Host $host;  
    proxy_set_header X-Real-IP $remote_addr;
  }

maybe there's a better way?

from openobserve.

desprit avatar desprit commented on May 24, 2024

@hengfeiyang
Yes, much better, thank you!

from openobserve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.