mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-06 17:08:10 +02:00
Clean nginx code
This commit is contained in:
@@ -3,8 +3,7 @@ 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;
|
||||||
server_name jellyfin.*;
|
root /usr/share/jellyfin;
|
||||||
root /usr/share/jellyfin/web;
|
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Security / XSS Mitigation Headers
|
# Security / XSS Mitigation Headers
|
||||||
@@ -12,36 +11,17 @@ server {
|
|||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
add_header X-Content-Type-Options "nosniff";
|
add_header X-Content-Type-Options "nosniff";
|
||||||
|
|
||||||
location /web/ {
|
location = / {
|
||||||
add_header Access-Control-Allow-Origin *;
|
absolute_redirect off; # Do not add port to redirect
|
||||||
proxy_pass http://127.0.0.1:8096/web/index.html;
|
return 301 ./web/index.html; # The slash at the end is important.
|
||||||
proxy_buffering off;
|
proxy_set_header X-Forwarded-Proto $scheme; # Avoids mixed content
|
||||||
proxy_read_timeout 30;
|
|
||||||
proxy_pass_request_headers on;
|
|
||||||
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Host $http_host;
|
|
||||||
proxy_set_header Connection $http_connection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ (/web)?/socket {
|
location / {
|
||||||
# Proxy Jellyfin Websockets traffic
|
|
||||||
proxy_pass http://127.0.0.1:8096;
|
proxy_pass http://127.0.0.1:8096;
|
||||||
proxy_http_version 1.1;
|
proxy_buffering off;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_read_timeout 30;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_pass_request_headers on;
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Protocol $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Host $http_host;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user