我正尝试将Angular应用程序的所有请求的标头添加到外部API。过去,我是通过使用proxy_set_header
并将proxy_pass
指向正在运行的应用程序来完成此操作的。
我的配置如下。如您所见,我的Angular应用程序是一个静态文件。
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
if ($http_x_forwarded_proto != https) {
rewrite ^(.*) https://$host$1;
}
}
有什么方法可以proxy_pass
到静态应用程序?