vankop / jsoneditor-react

react wrapper implementation for https://github.com/josdejong/jsoneditor
MIT License
263 stars 106 forks source link

Missing css when using nginx to serve it #83

Closed can-007 closed 2 years ago

can-007 commented 2 years ago

when I use yarn start, it looks fine:

Screen Shot 2022-04-26 at 23 42 54

when I use yarn build and config nginx to serve it, it looks wrong:

Screen Shot 2022-04-26 at 23 44 18

The nginx.conf is:

http {

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    sendfile        on;

    keepalive_timeout  65;

    gzip  on;

    server {
        listen       3000;

        location / {
            #root   /usr/share/nginx/html;
            root   /....../build;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        location /stories {
            set         $args   $args;
            proxy_pass  http://localhost:8000;
        }
    }
}

Could you help make nginx version work like yarn startversion? Thanks.

vankop commented 2 years ago

I can't help you for setting up your webserver..