summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-03-26 11:25:44 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-11-07 15:21:50 -0600
commit37c3ebc8aba14ba7605fbbb9c4013cbd2513400d (patch)
tree448d71a5acf2e108519cc2ca48cd1cdc3e5070e8 /data/templates
parente2bab09cc31ed41149409bafe0a19568f244a963 (diff)
downloadvyos-1x-37c3ebc8aba14ba7605fbbb9c4013cbd2513400d.tar.gz
vyos-1x-37c3ebc8aba14ba7605fbbb9c4013cbd2513400d.zip
http api: T3412: use FastAPI as web framework; support application/json
Replace the Flask micro-framework with FastAPI, in order to support extensions to the API and OpenAPI 3.* generation. This change will remain backwards compatible with previous versions. Notably, the multipart forms version of requests remain supported; in addition application/json requests are now natively supported. (cherry picked from commit 0125fff200efe3259aa25953e7505f69679261f8)
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/https/nginx.default.tmpl4
1 files changed, 3 insertions, 1 deletions
diff --git a/data/templates/https/nginx.default.tmpl b/data/templates/https/nginx.default.tmpl
index 26d0b5d73..625ef4486 100644
--- a/data/templates/https/nginx.default.tmpl
+++ b/data/templates/https/nginx.default.tmpl
@@ -41,9 +41,11 @@ server {
ssl_protocols TLSv1.2 TLSv1.3;
# proxy settings for HTTP API, if enabled; 503, if not
- location ~ /(retrieve|configure|config-file|image|generate|show) {
+ location ~ /(retrieve|configure|config-file|image|generate|show|docs|openapi.json|redoc) {
{% if server.api %}
proxy_pass http://localhost:{{ server.api.port }};
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600;
proxy_buffering off;
{% else %}