Skip to content

Instantly share code, notes, and snippets.

@Meorawr
Last active June 27, 2023 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Meorawr/8c681c607f31879929db6c3057903986 to your computer and use it in GitHub Desktop.
Save Meorawr/8c681c607f31879929db6c3057903986 to your computer and use it in GitHub Desktop.
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name home.example.org;
ssl_certificate /etc/letsencrypt/live/home.example.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/home.example.org/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
add_header Strict-Transport-Security "max-age=31536000" always;
ssl_trusted_certificate /etc/letsencrypt/live/home.example.org/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
index index.html index.htm;
root /var/www/html;
autoindex off;
location / {
expires max;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param FQDN true;
}
location /admin/ {
root /var/www/html;
index index.php index.html index.htm;
}
location /jellyfin/ {
include snippets/proxy.conf;
proxy_pass http://localhost:8096;
}
location /lidarr/ {
include snippets/proxy.conf;
proxy_pass http://172.16.0.1:8686;
}
location /prowlarr/ {
include snippets/proxy.conf;
proxy_pass http://172.16.0.2:9696;
}
location /radarr/ {
include snippets/proxy.conf;
proxy_pass http://172.16.0.1:7878;
}
location /sonarr/ {
include snippets/proxy.conf;
proxy_set_header Host $proxy_host;
proxy_pass http://172.16.0.1:8989;
}
location /transmission/ {
include snippets/proxy.conf;
proxy_pass_header X-Transmission-Session-Id;
proxy_pass http://172.16.0.2:9091;
}
location ~ /\.ht {
deny all;
}
}
proxy_buffers 32 4k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect http:// $scheme://;
proxy_send_timeout 240;
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_set_header Connection $http_connection;
proxy_set_header Early-Data $ssl_early_data;
proxy_set_header Host $host;
proxy_set_header Proxy "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Method $request_method;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Uri $request_uri;
proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Real-IP $remote_addr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment