Nginx部署Angular程序

核心代码如下:

server {
        listen       9003;
        client_max_body_size 200m;
        proxy_read_timeout 600;
        server_name  zhushuyin;

        location /api {
            root   html;
            index  index.aspx index.html index.htm;
            proxy_pass http://192.168.106.36:9003;
            proxy_set_header  Host  $host;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X_Forwarded-For  $proxy_add_x_forwarded_for;
        }
        
        location / {
             root site;
             try_files $uri $uri/ /index.html;
        }
    }

 

posted @ 2021-09-28 15:38  段江涛IT  阅读(174)  评论(0编辑  收藏  举报
页脚HTML代码