私信  •  关注

Santosh Shinde

Santosh Shinde 最近创建的主题
Santosh Shinde 最近回复了
5 年前
回复了 Santosh Shinde 创建的主题 » 将nginx路由用于后端和前端

`

server {
    listen 9090;
        server_name 192.168.10.10;
        index index.html;

        location /api/v1/ {
                proxy_pass http://127.0.0.1:8080; #api ip and port
                proxy_http_version 1.1;
                proxy_set_header Connection "";
                proxy_set_header X-Real-IP     $proxy_add_x_forwarded_for;
        }
        location /{
                root /user/dist; # path of angular application upto dist
                try_files $uri $uri/ /index.html;
       }
}

`

http://192.168.10.10:9090