user http;
worker_processes 2;
error_log /var/log/nginx/error.log;
#pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include 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;
keepalive_timeout 65;
gzip on;
gzip_http_version 1.0;
gzip_min_length 1024;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
gzip_vary on;
client_max_body_size 4G;
server_tokens off;
ssl_ciphers ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!aNULL:!MD5:!EDH;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:10m;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
server {
listen 80;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl;
satisfy any;
allow 192.168.1.0/24;
allow 127.0.0.1/32;
deny all;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd;
ssl_certificate /etc/ssl/server.crt;
ssl_certificate_key /etc/ssl/server.key;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
location / {
proxy_pass http://127.0.0.1:7000/;
proxy_redirect default;
}
location /sab/ {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect default;
}
location /tv/ {
proxy_pass http://127.0.0.1:8081/tv/;
proxy_redirect default;
}
location /movies/ {
proxy_pass http://127.0.0.1:8082/movies/;
proxy_redirect default;
}
location /music/ {
proxy_pass http://127.0.0.1:8083/music/;
proxy_redirect default;
}
location /transmission/ {
proxy_pass_header X-Transmission-Session-Id;
proxy_pass http://127.0.0.1:9091/transmission/;
proxy_redirect off;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
include /etc/nginx/conf.d/*.conf;
}