1.7.7 后台管理

优质
小牛编辑
189浏览
2023-12-01

moa2-frontend

Moa2 Frontend

前后端分离

  • shop-server 3000
  • shop-admin 3010
  • nginx 8000 即3010
    • /api 即3000
worker_processes  1;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;

pid        logs/nginx.pid;


events {
    worker_connections  1024;
}



http {
    # include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

    access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    server {
        listen       8000;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location / {
            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_set_header Host $http_host;
              proxy_set_header X-NginX-Proxy true;
              proxy_pass http://127.0.0.1:3010;
            proxy_redirect off;
        } 


        # Load configuration files for the default server block.
        # include /etc/nginx/default.d/*.conf;
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location /api {
            proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
              proxy_set_header X-NginX-Proxy true;
              proxy_pass http://127.0.0.1:3000;
            proxy_redirect off;
        }
    }
}

测试/api

列表

https://github.com/wenzhixin/bootstrap-table