Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Standard server configuration nothing to do in this part
- user nginx;
- worker_processes 1;
- error_log /var/log/nginx/error.log warn;
- pid /var/run/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include /etc/nginx/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;
- #tcp_nopush on;
- keepalive_timeout 65;
- #gzip on;
- # this if to rewrite all addresses going to my server in http into https
- server {
- listen 80;
- server_name p2p.example.net;
- rewrite ^ https://$server_name$request_uri? permanent;
- }
- server {
- listen 443; # here you can also specifie the ip or ips to listen to, if a lot of NICs ex. 192.168.1.1:443
- server_name p2p.example.net; # hostname
- access_log off; # Enable of disable Logs
- auth_basic "Please login"; # Message that will be shown when login
- # you must disable auth on the transmission daemon server, otherwise, you'll
- # have to login twice. basically nginx proxy takes care of auth from now and on
- # you can create this file by htpasswd command line tool, that comes with apache
- auth_basic_user_file /.ProxyUsers; # remove the . to be visible
- # setup self signed SSL, there was a tutorial i followed online
- # it's generic for all servers, just make sure file paths are right and
- # that nginx can read the files (proper permission)
- ssl on;
- ssl_certificate /root/server.crt;
- ssl_certificate_key /root/server.key;
- ssl_session_timeout 5m;
- ssl_protocols SSLv2 SSLv3 TLSv1;
- ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
- ssl_prefer_server_ciphers on;
- # Thats the important part. Most of the tutorial on the net are not Transmission specific
- # and don't pass the Transmission-Session Header
- location / {
- proxy_read_timeout 300;
- proxy_pass_header X-Transmission-Session-Id;
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Server $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # if you changed the port number for transmission daemon, then adjust the
- # folllowing line
- proxy_pass http://127.0.0.1:9091/transmission/web/;
- }
- # Also Transmission specific
- location /rpc {
- proxy_pass http://127.0.0.1:9091/transmission/rpc;
- }
- location /upload {
- proxy_pass http://127.0.0.1:9091/transmission/upload;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement