Code:
worker_processes auto;
error_log logs\error.log;
events {
worker_connections 8192;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
server_tokens off;
## The below will create a seperate log file for your emby server which includes
## userId's and other emby specific info, handy for external log viewers.
log_format emby '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time $server_port "$http_x_emby_authorization"';
log_format default '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time $server_port';
sendfile off; ## Sendfile not used in a proxy environment.
gzip on; ## Compresses the content to the client, speeds up client browsing.
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
image/svg+xml;
tcp_nodelay on; ## Sends data as fast as it can not buffering large chunks, saves about 200ms per request.
##include perfect-forward-secrecy.conf;
server {
listen [::]:80; ## Listens on port 80 IPv6
listen 80; ## Listens on port 80 IPv4
listen [::]:443 ssl http2; ## Listens on port 443 IPv6 with http2 and ssl enabled
listen 443 ssl http2; ## Listens on port 443 IPv4 with http2 and ssl enabled
server_name server.extensivesnare.info; ## enter your service name and domain name here example emby.domainname.com
access_log logs\access.log emby; ## Creates a log file with this name and the log info above.
## SSL SETTINGS ##
ssl_session_timeout 30m;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_certificate ssl/emby.pem; ## Location of your public PEM file.
ssl_certificate_key ssl/private.key; ## Location of your private PEM file.
ssl_session_cache shared:SSL:10m;
location / {
proxy_pass http://127.0.0.1:8096; ## Enter the IP and port of the backend emby server here.
proxy_hide_header X-Powered-By; ## Hides nginx server version from bad guys.
proxy_set_header Range $http_range; ## Allows specific chunks of a file to be requested.
proxy_set_header If-Range $http_if_range; ## Allows specific chunks of a file to be requested.
proxy_set_header X-Real-IP $remote_addr; ## Passes the real client IP to the backend server.
proxy_set_header Host $host; ## Passes the requested domain name to the backend server.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ## Adds forwarded IP to the list of IPs that were forwarded to the backend server.
## ADDITIONAL SECURITY SETTINGS ##
## Optional settings to improve security ##
## add these after you have completed your testing and ssl setup ##
add_header 'Referrer-Policy' 'origin-when-cross-origin';
add_header Strict-Transport-Security "max-age=15552000; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
## WEBSOCKET SETTINGS ## Used to pass two way real time info to and from emby and the client.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_connect_timeout 1h;
proxy_send_timeout 1h;
proxy_read_timeout 1h;
}
location /sonarr {
proxy_pass http://127.0.0.1:8989;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /radarr {
proxy_pass http://127.0.0.1:7878;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location /lidarr {
proxy_pass http://127.0.0.1:9008;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /calibre {
proxy_buffering off;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:7070$request_uri;
}
}
}