forked from tsaridas/stremio-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nginx Basic Auth for web,server and addons
- Added some possible solutions one might use to secure stremio server, stremio web and addons with a basic auth
- Loading branch information
Showing
4 changed files
with
254 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# stremio.mydomain.com | ||
# ------------------------------------------------------------ | ||
map $scheme $hsts_header { | ||
https "max-age=63072000; preload"; | ||
} | ||
|
||
server { | ||
set $forward_scheme http; | ||
set $server "stremio-container"; | ||
set $port 8080; | ||
|
||
listen 80; | ||
listen [::]:80; | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
|
||
server_name stremio.mydomain.com; | ||
|
||
# Let's Encrypt SSL | ||
include conf.d/include/letsencrypt-acme-challenge.conf; | ||
include conf.d/include/ssl-ciphers.conf; | ||
ssl_certificate /etc/letsencrypt/live/npm-4/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/npm-4/privkey.pem; | ||
|
||
access_log /data/logs/proxy-host-11_access.log proxy; | ||
error_log /data/logs/proxy-host-11_error.log warn; | ||
|
||
# Common proxy headers | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-Scheme $scheme; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
|
||
# Stremio-specific routes | ||
location ~ ^/(hlsv2|casting|local-addon|proxy|rar|zip|settings|create|removeAll|samples|probe|subtitlesTracks|opensubHash|subtitles|network-info|device-info|get-https|hwaccel-profiler|status|exec|stream) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location ~ ^/([^/]+)/(stats\.json|create|remove|destroy) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location ~ ^/([^/]+)/([^/]+)/(stats\.json|hls\.m3u8|master\.m3u8|stream\.m3u8|dlna|thumb\.jpg) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location ~ ^/([^/]+)/([^/]+)/(stream-q-[^/]+\.m3u8|stream-[^/]+\.m3u8|subs-[^/]+\.m3u8) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location ~ ^/([^/]+)/([^/]+)/(stream-q-[^/]+|stream-[^/]+)/[^/]+\.(ts|mp4) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location ~ ^/yt/([^/]+)(\.json)? { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
location = /(thumb\.jpg|stats\.json) { | ||
proxy_pass http://stremio-container:11470; | ||
} | ||
|
||
# Self hosted addons, in this case comet. Depends on the plugin if it supports a url prefix | ||
location /comet { | ||
proxy_pass http://stremio-comet:8111; | ||
} | ||
|
||
# Stremio web ui | ||
location / { | ||
# Proxy! | ||
include conf.d/include/proxy.conf; | ||
} | ||
|
||
# Custom | ||
include /data/nginx/custom/server_proxy[.]conf; | ||
} |
Oops, something went wrong.