This commit is contained in:
Alexandre
2022-07-03 08:52:23 +02:00
committed by GitHub
parent b07fd90284
commit a0a1eeb9a8
7 changed files with 252 additions and 252 deletions

View File

@@ -1,96 +1,96 @@
types { types {
text/html html htm shtml; text/html html htm shtml;
text/css css; text/css css;
text/xml xml; text/xml xml;
image/gif gif; image/gif gif;
image/jpeg jpeg jpg; image/jpeg jpeg jpg;
application/javascript js; application/javascript js;
application/atom+xml atom; application/atom+xml atom;
application/rss+xml rss; application/rss+xml rss;
text/mathml mml; text/mathml mml;
text/plain txt; text/plain txt;
text/vnd.sun.j2me.app-descriptor jad; text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml; text/vnd.wap.wml wml;
text/x-component htc; text/x-component htc;
image/png png; image/png png;
image/svg+xml svg svgz; image/svg+xml svg svgz;
image/tiff tif tiff; image/tiff tif tiff;
image/vnd.wap.wbmp wbmp; image/vnd.wap.wbmp wbmp;
image/webp webp; image/webp webp;
image/x-icon ico; image/x-icon ico;
image/x-jng jng; image/x-jng jng;
image/x-ms-bmp bmp; image/x-ms-bmp bmp;
font/woff woff; font/woff woff;
font/woff2 woff2; font/woff2 woff2;
application/java-archive jar war ear; application/java-archive jar war ear;
application/json json; application/json json;
application/mac-binhex40 hqx; application/mac-binhex40 hqx;
application/msword doc; application/msword doc;
application/pdf pdf; application/pdf pdf;
application/postscript ps eps ai; application/postscript ps eps ai;
application/rtf rtf; application/rtf rtf;
application/vnd.apple.mpegurl m3u8; application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml; application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz; application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls; application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot; application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt; application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg; application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp; application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods; application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt; application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx; pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx; xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx; docx;
application/vnd.wap.wmlc wmlc; application/vnd.wap.wmlc wmlc;
application/x-7z-compressed 7z; application/x-7z-compressed 7z;
application/x-cocoa cco; application/x-cocoa cco;
application/x-java-archive-diff jardiff; application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp; application/x-java-jnlp-file jnlp;
application/x-makeself run; application/x-makeself run;
application/x-perl pl pm; application/x-perl pl pm;
application/x-pilot prc pdb; application/x-pilot prc pdb;
application/x-rar-compressed rar; application/x-rar-compressed rar;
application/x-redhat-package-manager rpm; application/x-redhat-package-manager rpm;
application/x-sea sea; application/x-sea sea;
application/x-shockwave-flash swf; application/x-shockwave-flash swf;
application/x-stuffit sit; application/x-stuffit sit;
application/x-tcl tcl tk; application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt; application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi; application/x-xpinstall xpi;
application/xhtml+xml xhtml; application/xhtml+xml xhtml;
application/xspf+xml xspf; application/xspf+xml xspf;
application/zip zip; application/zip zip;
application/octet-stream bin exe dll; application/octet-stream bin exe dll;
application/octet-stream deb; application/octet-stream deb;
application/octet-stream dmg; application/octet-stream dmg;
application/octet-stream iso img; application/octet-stream iso img;
application/octet-stream msi msp msm; application/octet-stream msi msp msm;
audio/midi mid midi kar; audio/midi mid midi kar;
audio/mpeg mp3; audio/mpeg mp3;
audio/ogg ogg; audio/ogg ogg;
audio/x-m4a m4a; audio/x-m4a m4a;
audio/x-realaudio ra; audio/x-realaudio ra;
video/3gpp 3gpp 3gp; video/3gpp 3gpp 3gp;
video/mp2t ts; video/mp2t ts;
video/mp4 mp4; video/mp4 mp4;
video/mpeg mpeg mpg; video/mpeg mpeg mpg;
video/quicktime mov; video/quicktime mov;
video/webm webm; video/webm webm;
video/x-flv flv; video/x-flv flv;
video/x-m4v m4v; video/x-m4v m4v;
video/x-mng mng; video/x-mng mng;
video/x-ms-asf asx asf; video/x-ms-asf asx asf;
video/x-ms-wmv wmv; video/x-ms-wmv wmv;
video/x-msvideo avi; video/x-msvideo avi;
} }

View File

@@ -1,15 +1,15 @@
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_ignore_client_abort off; proxy_ignore_client_abort off;
proxy_read_timeout 86400s; proxy_read_timeout 86400s;
proxy_redirect off; proxy_redirect off;
proxy_send_timeout 86400s; proxy_send_timeout 86400s;
proxy_max_temp_file_size 0; proxy_max_temp_file_size 0;
proxy_set_header Accept-Encoding ""; proxy_set_header Accept-Encoding "";
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
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 X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true; proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;

View File

@@ -1 +1 @@
resolver 127.0.0.11; resolver 127.0.0.11;

View File

@@ -1,6 +1,6 @@
root /dev/null; root /dev/null;
server_name $hostname; server_name $hostname;
add_header X-Content-Type-Options nosniff; add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none; add_header X-Robots-Tag none;

View File

@@ -1,9 +1,9 @@
ssl_protocols TLSv1.2; ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
ssl_ecdh_curve secp384r1; ssl_ecdh_curve secp384r1;
ssl_session_timeout 10m; ssl_session_timeout 10m;
ssl_session_cache shared:SSL:10m; ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; ssl_session_tickets off;
ssl_stapling on; ssl_stapling on;
ssl_stapling_verify on; ssl_stapling_verify on;

View File

@@ -1,55 +1,55 @@
# Run nginx in foreground. # Run nginx in foreground.
daemon off; daemon off;
# This is run inside Docker. # This is run inside Docker.
user root; user root;
# Pid storage location. # Pid storage location.
pid /var/run/nginx.pid; pid /var/run/nginx.pid;
# Set number of worker processes. # Set number of worker processes.
worker_processes 1; worker_processes 1;
# Enables the use of JIT for regular expressions to speed-up their processing. # Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on; pcre_jit on;
# Write error log to Hass.io add-on log. # Write error log to Hass.io add-on log.
error_log /proc/1/fd/1 error; error_log /proc/1/fd/1 error;
# Load allowed environment vars # Load allowed environment vars
env HASSIO_TOKEN; env HASSIO_TOKEN;
# Load dynamic modules. # Load dynamic modules.
include /etc/nginx/modules/*.conf; include /etc/nginx/modules/*.conf;
# Max num of simultaneous connections by a worker process. # Max num of simultaneous connections by a worker process.
events { events {
worker_connections 512; worker_connections 512;
} }
http { http {
include /etc/nginx/includes/mime.types; include /etc/nginx/includes/mime.types;
log_format hassio '[$time_local] $status ' log_format hassio '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) ' '$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)'; '$request ($http_user_agent)';
access_log /proc/1/fd/1 hassio; access_log /proc/1/fd/1 hassio;
client_max_body_size 4G; client_max_body_size 4G;
default_type application/octet-stream; default_type application/octet-stream;
gzip on; gzip on;
keepalive_timeout 65; keepalive_timeout 65;
sendfile on; sendfile on;
server_tokens off; server_tokens off;
tcp_nodelay on; tcp_nodelay on;
tcp_nopush on; tcp_nopush on;
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {
default upgrade; default upgrade;
'' close; '' close;
} }
include /etc/nginx/includes/resolver.conf; include /etc/nginx/includes/resolver.conf;
include /etc/nginx/servers/*.conf; include /etc/nginx/servers/*.conf;
} }

View File

@@ -1,70 +1,70 @@
server { server {
listen %%interface%%:%%port%% default_server; listen %%interface%%:%%port%% default_server;
include /etc/nginx/includes/server_params.conf; include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf; include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0; client_max_body_size 0;
location / { location / {
# Security # Security
###################### ######################
allow 172.30.32.2; allow 172.30.32.2;
deny all; deny all;
proxy_hide_header "X-Content-Type-Options"; proxy_hide_header "X-Content-Type-Options";
# Base # Base
###################### ######################
#proxy_bind $server_addr; #proxy_bind $server_addr;
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:8080;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off; proxy_buffering off;
proxy_read_timeout 30; proxy_read_timeout 30;
# Avoid mixed contents # Avoid mixed contents
###################### ######################
if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$") if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$")
{ {
set $x_scheme $1; set $x_scheme $1;
set $x_host $2; set $x_host $2;
set $x_port ":$3"; set $x_port ":$3";
} }
if ($http_referer ~* "^(http[s]?)://([^:]+)(/.*)$") if ($http_referer ~* "^(http[s]?)://([^:]+)(/.*)$")
{ {
set $x_scheme $1; set $x_scheme $1;
set $x_host $2; set $x_host $2;
set $x_port ""; set $x_port "";
} }
proxy_set_header X-Scheme $x_scheme; proxy_set_header X-Scheme $x_scheme;
proxy_redirect http://$host/ $x_scheme://$x_host$x_port/; proxy_redirect http://$host/ $x_scheme://$x_host$x_port/;
proxy_redirect $x_scheme://$host/ $x_scheme://$x_host$x_port/; proxy_redirect $x_scheme://$host/ $x_scheme://$x_host$x_port/;
# Allow subpath # Allow subpath
###################### ######################
proxy_set_header X-Script-Name %%ingress_entry%%; proxy_set_header X-Script-Name %%ingress_entry%%;
proxy_cookie_path / %%ingress_entry%%/; proxy_cookie_path / %%ingress_entry%%/;
# Allow iframe # Allow iframe
###################### ######################
proxy_hide_header "Content-Security-Policy"; proxy_hide_header "Content-Security-Policy";
proxy_hide_header X-Frame-Options; proxy_hide_header X-Frame-Options;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
proxy_set_header Accept-Encoding ""; proxy_set_header Accept-Encoding "";
# Rewrite url # Rewrite url
###################### ######################
sub_filter_once off; sub_filter_once off;
sub_filter_types *; sub_filter_types *;
sub_filter "/static" "%%ingress_entry%%/static"; sub_filter "/static" "%%ingress_entry%%/static";
sub_filter "/media" "%%ingress_entry%%/media"; sub_filter "/media" "%%ingress_entry%%/media";
sub_filter "/view" "%%ingress_entry%%/view"; sub_filter "/view" "%%ingress_entry%%/view";
sub_filter "/search" "%%ingress_entry%%/search"; sub_filter "/search" "%%ingress_entry%%/search";
sub_filter "/edit" "%%ingress_entry%%/edit"; sub_filter "/edit" "%%ingress_entry%%/edit";
#sub_filter "%%ingress_entry%%/%%ingress_entry%%/" "/"; #sub_filter "%%ingress_entry%%/%%ingress_entry%%/" "/";
#sub_filter "/api" "%%ingress_entry%%/api"; #sub_filter "/api" "%%ingress_entry%%/api";
#sub_filter "%%ingress_entry%%/api/hassio" "/api/hassio"; #sub_filter "%%ingress_entry%%/api/hassio" "/api/hassio";
} }
} }