File size: 859 Bytes
23c5b0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

    #front-end
    server {
        listen       8000;
        server_name  localhost;
        location / {
            root   /tmp/front_work_dir;
            index  index.html index.htm;
        }
        #error_page  404              /404.html;
    }

    # 反向代理 front-end 和 back-end
    server {
        listen       80;
        listen       [::]:80;
        server_name  onlyyounotothers.top www.onlyyounotothers.top;
        # http 重定向到 https
        return 301 https://onlyyounotothers.top$request_uri;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://localhost:8000/;
        }
        location /api/ {
            rewrite ^/b/(.*)$ /$1 break; # 去除本地接口/api前缀, 否则会出现404
            proxy_pass http://110.40.137.191:3000/;
        }
    }