Simplify nginx ingress config
This commit is contained in:
parent
40d0bf6b60
commit
10d21e62cc
@ -1,5 +1,5 @@
|
|||||||
name: "3DPrinter-OctoPrint"
|
name: "3DPrinter-OctoPrint"
|
||||||
version: "2022.9.006"
|
version: "2022.9.007"
|
||||||
slug: "3dprinter-octoprint"
|
slug: "3dprinter-octoprint"
|
||||||
description: "OctoPrint as an addon, no additional bells and whistles."
|
description: "OctoPrint as an addon, no additional bells and whistles."
|
||||||
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
url: "https://github.com/fredrikbaberg/home-assistant-addons/tree/main/3dprinter-octoprint"
|
||||||
|
|||||||
@ -1,29 +1,31 @@
|
|||||||
server {
|
server {
|
||||||
listen {{ .interface }}:{{ .port }} default_server;
|
listen {{ .interface }}:{{ .port }} default_server;
|
||||||
|
server_name $hostname;
|
||||||
include /etc/nginx/includes/server_params.conf;
|
|
||||||
include /etc/nginx/includes/proxy_params.conf;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
allow 172.30.32.2;
|
allow 172.30.32.2;
|
||||||
deny all;
|
deny all;
|
||||||
|
|
||||||
proxy_pass http://octoprint/; # make sure to add trailing slash here!
|
proxy_pass http://octoprint/;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For 172.30.32.2; # Intentional, use autologin local instead of $proxy_add_x_forwarded_for for Ingress.
|
proxy_set_header X-Forwarded-For 172.30.32.2; # Intentional, for autologin.
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Scheme $scheme;
|
||||||
proxy_set_header X-Script-Name {{ .ingress_entry }};
|
proxy_set_header X-Script-Name {{ .ingress_entry }};
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
client_max_body_size 0;
|
|
||||||
|
client_max_body_size 0;
|
||||||
# proxy_set_header X-XSRF-TOKEN $http_x_xsrf_token;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /webcam/ {
|
location /webcam/ {
|
||||||
proxy_pass {{ .camera_host }};
|
proxy_pass {{ .camera_host }};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user