Advertisement
Sray69

NGINX Script

May 14th, 2017
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. # HTTP Server info (Un-Secured)
  2. #-------------------------------------------------------------------------
  3. server {
  4. listen 80;
  5. server_name username.asuscomm.com 192.168.1.198 localhost;
  6. return 301 https://$server_name$request_uri; # enforce https
  7. }
  8.  
  9. # HTTPS Server info (Secured)
  10. #-------------------------------------------------------------------------
  11. server {
  12. server_name username.asuscomm.com 192.168.1.198;
  13. listen 443 ssl;
  14. ssl_certificate /etc/nginx/ssl/nginx.crt;
  15. ssl_certificate_key /etc/nginx/ssl/nginx.key;
  16. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  17. ssl_prefer_server_ciphers on;
  18. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  19. ssl_session_cache shared:SSL:10m;
  20.  
  21. # Plex at port 32400 **WORKS**
  22. #-------------------------------------------------------------------------
  23. location /web {
  24. proxy_pass http://127.0.0.1:32400;
  25. proxy_set_header Host $host;
  26. proxy_set_header X-Real-IP $remote_addr;
  27. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  28. }
  29.  
  30. # Redirects /plex to /web so you can use /plex in your address
  31. location /plex {
  32. proxy_pass http://127.0.0.1/web;
  33. }
  34.  
  35. # Radarr at port 7878 **WORKS**
  36. #-------------------------------------------------------------------------
  37. location /radarr {
  38. proxy_pass http://127.0.0.1:7878;
  39. proxy_set_header Host $host;
  40. proxy_set_header X-Real-IP $remote_addr;
  41. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  42. }
  43.  
  44. # Sonarr at port 8989 **WORKS - but no AUTH**
  45. #-------------------------------------------------------------------------
  46. location /nzbdrone {
  47. proxy_pass http://127.0.0.1:8989;
  48. proxy_set_header Host $host;
  49. proxy_set_header X-Real-IP $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. }
  52.  
  53. # deluge at port 8112 **Does not connect at all**
  54. #-------------------------------------------------------------------------
  55. location /deluge {
  56. proxy_pass http://127.0.0.1:8112;
  57. proxy_set_header X-Deluge-Base "/deluge/";
  58. #proxy_set_header X-Real-IP $remote_addr;
  59. #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  60. auth_basic "Password Required";
  61. auth_basic_user_file /etc/nginx/.htpasswd;
  62. }
  63.  
  64. # NZBGet at port 6789 **WORKS - but no AUTH**
  65. #-------------------------------------------------------------------------
  66. location /nzbget {
  67. proxy_pass http://127.0.0.1:6789;
  68. proxy_set_header Host $host;
  69. proxy_set_header X-Real-IP $remote_addr;
  70. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  71. auth_basic "Password Required";
  72. auth_basic_user_file /etc/nginx/.htpasswd;
  73. }
  74.  
  75. # Headphones at port 8181 **WORKS**
  76. #-------------------------------------------------------------------------
  77. location /headphones {
  78. proxy_pass http://127.0.0.1:8181;
  79. proxy_set_header Host $host;
  80. proxy_set_header X-Real-IP $remote_addr;
  81. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement