Add nginx
This commit is contained in:
parent
8380db9ab4
commit
294cca47c6
18
3dprinter-octoprint/rootfs/etc/cont-init.d/proxy.sh
Normal file
18
3dprinter-octoprint/rootfs/etc/cont-init.d/proxy.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Prepare proxy
|
||||||
|
# s6-overlay docs: https://github.com/just-containers/s6-overlay
|
||||||
|
# ==============================================================================
|
||||||
|
|
||||||
|
bashio::log.info "Proxy cont-init.d"
|
||||||
|
|
||||||
|
ingress_entry=$(bashio::addon.ingress_entry)
|
||||||
|
export ingress_entry=${ingress_entry}
|
||||||
|
|
||||||
|
# Make sure output folder exists.
|
||||||
|
mkdir -p /etc/nginx/http.d/
|
||||||
|
|
||||||
|
tempio \
|
||||||
|
-conf /data/options.json \
|
||||||
|
-template /usr/share/tempio/ingress.conf \
|
||||||
|
-out /etc/nginx/http.d/ingress.conf
|
||||||
23
3dprinter-octoprint/rootfs/usr/share/tempio/ingress.conf
Normal file
23
3dprinter-octoprint/rootfs/usr/share/tempio/ingress.conf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
upstream "octoprint" {
|
||||||
|
server 127.0.0.1:5000;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8099;
|
||||||
|
allow 172.30.32.2;
|
||||||
|
deny all;
|
||||||
|
|
||||||
|
location /{{ env "ingress_entry" }}/ {
|
||||||
|
proxy_pass http://octoprint/; # make sure to add trailing slash here!
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Scheme $scheme;
|
||||||
|
proxy_set_header X-Script-Name /{{ env "ingress_entry" }};
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
client_max_body_size 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user