109 lines
3.0 KiB
Nginx Configuration File
109 lines
3.0 KiB
Nginx Configuration File
user root;
|
|
worker_processes auto;
|
|
|
|
error_log /var/log/nginx/error.log notice;
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
#gzip on;
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_comp_level 9;
|
|
gzip_types text/plain application/x-javascript text/javascript application/x-httpd-php text/css text/xml text/jsp application/eot application/ttf application/otf application/svg application/woff application/javascript application/xml image/jpeg image/gif image/png;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [1-6].";
|
|
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
|
|
server
|
|
{
|
|
listen 80;
|
|
listen 443 ssl http2;
|
|
server_name localhost;
|
|
ssl_certificate /usr/share/nginx/html/cert.pem;
|
|
ssl_certificate_key /usr/share/nginx/html/key.pem;
|
|
|
|
|
|
|
|
|
|
location /uniapp_im/ {
|
|
alias /usr/share/nginx/html/im-uniapp/dist/;
|
|
}
|
|
|
|
location /hd-glasses-app/ {
|
|
alias /usr/share/nginx/html/hd-glasses-app/dist/;
|
|
}
|
|
|
|
|
|
|
|
# For SRS homepage, console and players
|
|
# http://r.ossrs.net/console/
|
|
# http://r.ossrs.net/players/
|
|
location ~ ^/(console|players)/ {
|
|
proxy_pass http://127.0.0.1:8080/$request_uri;
|
|
}
|
|
|
|
# For SRS streaming, for example:
|
|
# http://r.ossrs.net/live/livestream.flv
|
|
# http://r.ossrs.net/live/livestream.m3u8
|
|
location ~ ^/.+/.*\.(flv|m3u8|ts|aac|mp3)$ {
|
|
proxy_pass http://127.0.0.1:8080$request_uri;
|
|
}
|
|
# For SRS backend API for console.
|
|
# For SRS WebRTC publish/play API.
|
|
location ~ ^/(api|rtc)/ {
|
|
proxy_pass http://127.0.0.1:1985$request_uri;
|
|
}
|
|
|
|
|
|
# For SRS streaming, for example:
|
|
# http://r.ossrs.net/live/livestream.flv
|
|
# http://r.ossrs.net/live/livestream.m3u8
|
|
location ~ /.+/.*\.(flv|m3u8|ts|aac|mp3)$ {
|
|
proxy_pass http://127.0.0.1:8080$request_uri;
|
|
}
|
|
|
|
location /demos/ {
|
|
proxy_pass http://127.0.0.1:1989/demos/;
|
|
}
|
|
|
|
location /sig/ {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_pass http://127.0.0.1:1989/sig/;
|
|
}
|
|
|
|
access_log /home/wwwlogs/srslog;
|
|
}
|
|
|
|
|
|
|
|
include /etc/nginx/conf.d/*.conf;
|
|
}
|