mirror of
git://soft.sys114.com/mainsail
synced 2026-02-04 12:50:37 +09:00
debian: add nignx
This commit is contained in:
2
debian/control
vendored
2
debian/control
vendored
@@ -8,6 +8,6 @@ X-Python3-Version: >= 3.7
|
||||
|
||||
Package: mainsail
|
||||
Architecture: any
|
||||
Depends: ${misc:Pre-Depends}
|
||||
Depends: ${misc:Pre-Depends}, nginx
|
||||
Description: Mainsail for Klipper
|
||||
...
|
||||
|
||||
7
debian/mainsail.install
vendored
7
debian/mainsail.install
vendored
@@ -6,8 +6,13 @@ files=$(find \( -name . -o \
|
||||
-name .git -prune -o \
|
||||
-name .github -prune -o \
|
||||
-name .gitignore -prune -o \
|
||||
-name debian -prune \) -o -print | sed -e 's/^\.\///')
|
||||
-name debian -prune -o \
|
||||
-name nginx -prune \) -o -print | sed -e 's/^\.\///')
|
||||
|
||||
for f in ${files}; do
|
||||
echo "${f} ${ROOT_PATH}/$(dirname ${f})"
|
||||
done
|
||||
|
||||
echo "nginx/conf.d/* /etc/nginx/conf.d/"
|
||||
echo "nginx/sites-available/mainsail /etc/nginx/sites-available/"
|
||||
echo "nginx/sites-enabled/mainsail /etc/nginx/sites-enabled/"
|
||||
5
debian/mainsail.postinst
vendored
Normal file
5
debian/mainsail.postinst
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
|
||||
#DEBHELPER#
|
||||
4
nginx/conf.d/common_vars.conf
Normal file
4
nginx/conf.d/common_vars.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
4
nginx/conf.d/upstream.conf
Normal file
4
nginx/conf.d/upstream.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
upstream apiserver {
|
||||
ip_hash;
|
||||
server 127.0.0.1:7125;
|
||||
}
|
||||
59
nginx/sites-available/mainsail
Normal file
59
nginx/sites-available/mainsail
Normal file
@@ -0,0 +1,59 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
# uncomment the next line to activate IPv6
|
||||
# listen [::]:80 default_server;
|
||||
|
||||
access_log /var/log/nginx/mainsail-access.log;
|
||||
error_log /var/log/nginx/mainsail-error.log;
|
||||
|
||||
# disable this section on smaller hardware like a pi zero
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_comp_level 4;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript application/json application/xml;
|
||||
|
||||
# web_path from mainsail static files
|
||||
root /usr/lib/mainsail;
|
||||
|
||||
index index.html;
|
||||
server_name _;
|
||||
|
||||
# disable max upload size checks
|
||||
client_max_body_size 0;
|
||||
|
||||
# disable proxy request buffering
|
||||
proxy_request_buffering off;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
}
|
||||
|
||||
location /websocket {
|
||||
proxy_pass http://apiserver/websocket;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location ~ ^/(printer|api|access|machine|server)/ {
|
||||
proxy_pass http://apiserver$request_uri;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
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;
|
||||
}
|
||||
}
|
||||
1
nginx/sites-enabled/mainsail
Symbolic link
1
nginx/sites-enabled/mainsail
Symbolic link
@@ -0,0 +1 @@
|
||||
../sites-available/mainsail
|
||||
Reference in New Issue
Block a user