Skip to content

Instantly share code, notes, and snippets.

@heartofrevel
Created February 8, 2019 16:51
Show Gist options
  • Save heartofrevel/6891a25169bbd28eeb785bd622dd8515 to your computer and use it in GitHub Desktop.
Save heartofrevel/6891a25169bbd28eeb785bd622dd8515 to your computer and use it in GitHub Desktop.
server {
listen 80;
#server_name <Domain Name>;
root /var/www;
index index.html index.php index.htm;
error_page 403 = @denied;
#Below enter IP address or block to allow, eg LAN and/or VPN blocks
allow 10.0.0.0/8;
allow 172.16.0.0/12;
allow 192.168.0.0/16;
deny all;
location @denied {
return 301 https://$host$request_uri;
}
location / {
try_files $uri $uri/ =404;
}
location /rutorrent {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
include /etc/nginx/conf.d/php;
include /etc/nginx/conf.d/cache;
}
#include /etc/nginx/sites-available/dload-loc;
location ~ /\.ht {
deny all;
}
}
server {
listen 443 ssl;
#server_name <Domain Name>;
root /var/www;
index index.html index.php index.htm;
client_max_body_size 40m;
ssl_certificate /etc/ssl/ruweb.crt;
ssl_certificate_key /etc/ssl/private/ruweb.key;
ssl_session_timeout 5m;
location / {
try_files $uri $uri/ =404;
}
location /rutorrent {
client_max_body_size 40m;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
include /etc/nginx/conf.d/php;
include /etc/nginx/conf.d/cache;
}
#include /etc/nginx/sites-available/dload-loc;
include /etc/nginx/sites-available/webmin-loc;
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment