Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated nginx configuration info

  • Loading branch information...
commit 3255d9907b598e03cb06b4948f9e32b808cab7b2 1 parent 79ea162
@davidbanham authored
Showing with 29 additions and 36 deletions.
  1. +6 −5 README.md
  2. +0 −31 config/nginx.ntor
  3. +23 −0 config/ntor.nginx
View
11 README.md
@@ -34,12 +34,15 @@ Install nginx. ( sudo apt-get install nginx ) or similar
Include conf/ntor.nginx in your configuration. On Ubuntu, just place the file in /etc/nginx/sites-enabled
-Edit the redirect in conf/ntor.nginx from ntor.example.com to whatever your domain is.
-
Create a htpasswd file to protect your rtorrent SCGI port. On Ubuntu:
htpasswd -c -d /etc/nginx/htpasswd rtorrent
Then enter the password when prompted.
+Redirect port 443 (https) to port 3000. On Ubuntu, I do this via iptables with the following command:
+
+sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3000
+sudo iptables-save
+
Copy conf/example.conf.js to conf/conf.js
Edit conf/conf.js and fill in the fields. You'll need to at least complete extDomain, cookieSecret and rtorrent.pass. extDomain is the domain name you will access ntor from, cookieSecret is any random string you like, rtorrent.pass is the password you entered earlier for htpasswd. Also, fill out the mail section with the details of whatever email account you want notification emails sent from.
@@ -66,6 +69,4 @@ What next?
ntor is designed to make it easy to add search workers for arbitrary trackers. I like interfaces like rutorrent, but was frustrated with how difficult it was to add new sites to the search. In ntor, each search engine or feed worker is implemented as a nodejs module. This means that whatever search your site uses, you can write an ntor plugin to handle it. Many sites don't expose a nice API, but node makes it easy to parse arbitrary HTML pages with jsdom and jquery. All kinds of authentication methods, cookies, etc can easily be handled with request. Take a look at the example plugins above to get started writing your own.
-The main TODO is to redo the frontend code in something like Angular. At the moment it's a rats nest of event handlers.
-
-Also, the routes in the app.js file could really use some logical organisation.
+If you're keen to help out, take a look at the Issues page.
View
31 config/nginx.ntor
@@ -1,31 +0,0 @@
-server {
- listen localhost:81;
- location /RPC2 {
- auth_basic "Restricted";
- auth_basic_user_file htpasswd;
- include scgi_params;
- scgi_pass localhost:5000;
- }
-}
-
-server {
- listen 80;
- location / {
- rewrite ^(.*) https://ntor.example.com/$1 permanent;
- }
-}
-
-server {
- listen 443;
-
- ssl on;
- ssl_certificate /etc/nginx/server.crt;
- ssl_certificate_key /etc/nginx/server.key;
-
- location / {
- #auth_basic "Restricted";
- #auth_basic_user_file htpasswd;
- proxy_pass http://localhost:3000/;
- include /etc/nginx/proxy.conf;
- }
-}
View
23 config/ntor.nginx
@@ -0,0 +1,23 @@
+server {
+ listen localhost:81;
+ location /RPC2 {
+ auth_basic "Restricted";
+ auth_basic_user_file htpasswd;
+ include scgi_params;
+ scgi_pass localhost:5000;
+ }
+}
+
+server {
+ listen 80;
+
+ location /incoming/ {
+ proxy_pass http://localhost:3000/incoming/;
+ include /etc/nginx/proxy.conf;
+ }
+
+ location / {
+ return 301 https://$host$request_uri;
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.