Sign inSign up

hydsoftiot/equipment-management-ui

By hydsoftiot

•Updated almost 5 years ago

equipment-management-ui

Image
0

207

hydsoftiot/equipment-management-ui repository overview

⁠Image

From offical nginx⁠ image

⁠Environment

ENV TZ=Asia/Shanghai \
    RUN_USER=nginx \
    RUN_GROUP=nginx \
    DATA_DIR=/data/web \
    LOG_DIR=/data/log/nginx

Put your front end files into /data/web. You can get nginx logs in /data/log/nginx

⁠Configuration file

Example of nginx.default.conf:

⁠nginx.default.conf
server {
    listen       your_backend_port;
    server_name  localhost;

    access_log  /data/log/nginx/access.log  main;
    error_log   /data/log/nginx/error.log;

    # static file
    location / {
        root   /data/web;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    # Proxy
    location ^~ /your_api{
        proxy_pass   http://your_api_uri
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Credentials: true;
        add_header Access-Control-Allow-Methods GET,POST,OPTIONS,PUT,DELETE;

        proxy_http_version 1.1;
        proxy_connect_timeout 3600s;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
        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_set_header Origin "";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

You may need to change the your_api and http://your_api_uri in configuration file to your own service api and api url.

⁠Volumes

mkdir /var/nginx && cd  /var/nginx
touch nginx.default.conf

Change nginx.default.conf refer to the example above.

 volumes:
      - /var/nginx/nginx.default.conf:/etc/nginx/conf.d/nginx.default.conf #mount nginx file

⁠Expose Port

We suggest exposing port:80 as the default port.

EXPOSE 80

Tag summary

Content type

Image

Digest

Size

58.3 MB

Last updated

almost 5 years ago

docker pull hydsoftiot/equipment-management-ui:v2