Last active
April 16, 2022 06:42
-
-
Save winlinvip/3622c232c0cd397ff0db5309a0bc4291 to your computer and use it in GitHub Desktop.
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
# For Proxy Cache. | |
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=srs_cache:8m max_size=1000m inactive=600m; | |
proxy_temp_path /tmp/nginx-cache/tmp; | |
server { | |
listen 80; | |
server_name your.domain.com; | |
# For Proxy Cache. | |
proxy_cache_valid 404 10s; | |
proxy_cache_lock on; | |
proxy_cache_lock_age 300s; | |
proxy_cache_lock_timeout 300s; | |
proxy_cache_min_uses 1; | |
location ~ /.+/.*\.(m3u8)$ { | |
proxy_pass http://127.0.0.1$request_uri; | |
# For Proxy Cache. | |
proxy_cache srs_cache; | |
proxy_cache_key $scheme$proxy_host$uri$args; | |
proxy_cache_valid 200 302 10s; | |
} | |
location ~ /.+/.*\.(ts)$ { | |
proxy_pass http://127.0.0.1$request_uri; | |
# For Proxy Cache. | |
proxy_cache srs_cache; | |
proxy_cache_key $scheme$proxy_host$uri; | |
proxy_cache_valid 200 302 60m; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment