Skip to content
Extraits de code Groupes Projets
Valider 92fe1847 rédigé par aftys's avatar aftys
Parcourir les fichiers

update setup.sh file

parent fc696f4d
Branches
Aucune requête de fusion associée trouvée
......@@ -35,143 +35,11 @@ sudo mkdir -p /tmp/dash
# SSL Setup: Copy SSL certificates to nginx SSL directory (replace with your actual certificate path)
sudo cp ./PositiveSSL_Wildcard_mydressin-server.com.pem /usr/local/nginx/conf/ssl/
# Configure optimized nginx.conf
sudo bash -c "cat > /usr/local/nginx/conf/nginx.conf" << 'EOF'
daemon off;
error_log /dev/stdout info;
events {
worker_connections 8192;
use epoll;
multi_accept on;
}
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
# HLS settings
hls on;
hls_path /tmp/hls;
hls_fragment 3s;
hls_playlist_length 18s;
hls_fragment_naming system;
hls_fragment_naming_granularity 2;
hls_fragment_slicing aligned;
# HLS bitrate variants
hls_variant _low BANDWIDTH=800000;
hls_variant _mid BANDWIDTH=1200000;
hls_variant _high BANDWIDTH=2400000;
# DASH settings
dash on;
dash_path /tmp/dash;
dash_fragment 3s;
dash_playlist_length 18s;
# Reduce CPU usage
meta copy;
}
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
server {
listen 443 ssl;
server_name hls.mydressin-server.com;
ssl_certificate /usr/local/nginx/conf/ssl/PositiveSSL_Wildcard_mydressin-server.com.pem;
ssl_certificate_key /usr/local/nginx/conf/ssl/PositiveSSL_Wildcard_mydressin-server.com.pem;
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
}
root /tmp;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
expires -1;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /usr/local/nginx/html;
}
location /control {
rtmp_control all;
add_header Access-Control-Allow-Origin * always;
}
location / {
root html;
index index.html index.htm;
}
}
server {
listen 80;
server_name hls.mydressin-server.com;
return 301 https://$server_name$request_uri;
}
}
EOF
# Create nginx config directory if it doesn't exist
sudo mkdir -p /usr/local/nginx/conf
# Copy nginx configuration file
sudo cp ./nginx.conf /usr/local/nginx/conf/nginx.conf
# Expose necessary ports (80 for HTTP, 443 for HTTPS, and 1935 for RTMP)
sudo ufw allow 80
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter