Advertisement
Roxedus

default

Sep 18th, 2017
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 10.22 KB | None | 0 0
  1. # listening on port 80 disabled by default, remove the "#" signs to enable
  2. # redirect all traffic to https
  3. #
  4. # Upstreams
  5. upstream plex-upstream {
  6.     server 10.0.0.11:32400;
  7.     keepalive 32;
  8. }
  9.  
  10. #Main block rewrite
  11. server {
  12.     listen 80;
  13.     server_name punny.no;
  14.     return 301 https://$host$request_uri;
  15. }
  16. server { #Force non www
  17.     listen 80;
  18.     listen 443 ssl http2;
  19.     server_name www.punny.no;
  20.     return 301 https://punny.no;
  21.    
  22.     ssl_certificate /config/keys/letsencrypt/fullchain.pem;
  23.     ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
  24.     ssl_dhparam /config/nginx/dhparams.pem;
  25.     ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  26.     ssl_prefer_server_ciphers on;
  27. }
  28.  
  29. ###############################################
  30.  
  31. #main server block
  32. server {
  33.     listen 443 ssl http2;
  34.     add_header X-Frame-Options SAMEORIGIN;
  35.     add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  36.  
  37.     #gzip            on;
  38.     #gzip_min_length 20;
  39.     #gzip_proxied    off;
  40.     #gzip_types     *;
  41.    
  42.     root /config/www/home;
  43.     index index.php index.html index.htm;
  44.    
  45.     server_name punny.no domain.no 10.0.0.11;
  46.  
  47.     ssl_certificate /config/keys/letsencrypt/fullchain.pem;
  48.     ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
  49.     ssl_dhparam /config/nginx/dhparams.pem;
  50.     ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  51.     ssl_prefer_server_ciphers on;
  52.  
  53.     client_max_body_size 0;
  54.    
  55.     error_page 400 401 402 403 404 405 408 500 502 503 504 $scheme://$server_name/error.php?error=$status;
  56.    
  57.     #AUTHORIZATION BLOCK    
  58.     location /auth-admin { rewrite ^ /auth.php?admin&ban=someone,thisperson; }
  59.     location /auth-user { rewrite ^ /auth.php?user; }
  60.    
  61.     location / {
  62.         try_files $uri $uri/ /index.html /index.php?$args =404;
  63.         proxy_set_header Accept-Encoding "";
  64.             location ~ \.php$ {
  65.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  66.                 fastcgi_pass 127.0.0.1:9000;
  67.                 fastcgi_index index.php;
  68.                 include /etc/nginx/fastcgi_params;
  69.             }
  70.         }
  71.    
  72. ###### REWRITES ###### 
  73.    
  74.     location /v2 {
  75.         return 301 /v2/;
  76.     }
  77.    
  78.     location /plexpy {
  79.         return 301 /plexpy/;
  80.     }
  81.    
  82.     location /sabnzbd {
  83.         return 301 /sabnzbd/;
  84.     }
  85.    
  86.     location /hydra {
  87.         return 301 /hydra/;
  88.     }
  89.    
  90. ###### REWRITES ###### 
  91.  
  92. ###### IMAGES ######
  93.  
  94.     location /cap {
  95.     alias /config/www/img/sharex;
  96.     default_type image/png;
  97.     }  
  98.    
  99.     location /me {
  100.     alias /config/www/img/public/me.png;
  101.     default_type image/png;
  102.     }  
  103.    
  104.     location /me.png {
  105.     alias /config/www/img/public/me.png;
  106.     default_type image/png;
  107.     }
  108.    
  109.     location /img {
  110.     alias /config/www/img;
  111.     }
  112.    
  113.     location /img/public {
  114.     alias /config/www/img/public;
  115.     }
  116. ###### IMAGES ######
  117.    
  118.     location /index.html {
  119.     alias /config/www/home/index1.html;
  120.     }
  121.    
  122.     location /v2/ {
  123.     root /config/www;
  124.     index index.php index.html;
  125.     include /config/php.conf;
  126.     }  
  127.    
  128.     location /clouds/ {
  129.     root /config/www;
  130.     index index.html;
  131.     include /config/php.conf;
  132.     }
  133.    
  134.     location /hp/ {
  135.     root /config/www;
  136.     index index.html;
  137.     include /config/php.conf;
  138.     }
  139.    
  140.     location /monitorr {
  141.         proxy_pass http://10.0.0.11:4078/monitorr;
  142.         add_header X-Frame-Options SAMEORIGIN;
  143.         proxy_set_header Host $host;
  144.         proxy_set_header X-Real-IP $remote_addr;
  145.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  146.     }
  147.    
  148.     location /logarr {
  149.         proxy_pass http://10.0.0.11:4878/logarr;
  150.         add_header X-Frame-Options SAMEORIGIN;
  151.         proxy_set_header Host $host;
  152.         proxy_set_header X-Real-IP $remote_addr;
  153.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  154.     }
  155.    
  156.     if ($http_referer ~* /ombi/) {
  157.     rewrite ^/dist/([0-9\d*]).js /ombi/dist/$1.js last;
  158.     }
  159.     location /ombi {
  160.         #auth_request /auth-user;
  161.         proxy_pass http://10.0.0.11:3579/ombi;
  162.         proxy_set_header Host $host;
  163.         proxy_set_header X-Real-IP $remote_addr;
  164.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  165.         add_header X-Frame-Options SAMEORIGIN;
  166.         }
  167.        
  168.     location /emby {
  169.       # Send traffic to the backend
  170.         add_header  Strict-Transport-Security max-age=31536000;
  171.         add_header X-Frame-Options SAMEORIGIN;
  172.         proxy_pass http://10.0.0.11:8096;
  173.         proxy_set_header X-Real-IP $remote_addr;
  174.         proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
  175.         proxy_set_header Host $host;
  176.         proxy_set_header X-Forwarded-Proto $remote_addr;
  177.         proxy_set_header X-Forwarded-Protocol $scheme;
  178.         proxy_redirect off;
  179.         # Send websocket data to the backend aswell
  180.         proxy_http_version 1.1;
  181.         proxy_set_header Upgrade $http_upgrade;
  182.         proxy_set_header Connection "upgrade";
  183.         }
  184.        
  185.     location /plexpy/ {
  186.         auth_request /auth-admin;
  187.         proxy_pass http://10.0.0.11:8181;
  188.         add_header X-Frame-Options SAMEORIGIN;
  189.         #proxy_set_header Host $host;
  190.         proxy_set_header X-Real-IP $remote_addr;
  191.         #proxy_set_header X-Forwarded-Host $server_name;
  192.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  193.         #proxy_set_header    X-Forwarded-Proto   $scheme; #plexpy needs this line 1
  194.         #proxy_set_header    X-Forwarded-Ssl     on;   #plexpy needs this line 2
  195.         }
  196.    
  197.     location /sabnzbd/ {
  198.         auth_request /auth-admin;
  199.         proxy_pass https://10.0.0.11:8190;
  200.         add_header X-Frame-Options SAMEORIGIN;
  201.         proxy_set_header Host $host;
  202.         proxy_set_header X-Real-IP $remote_addr;
  203.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  204.         }
  205.  
  206.     location /sabnzbd/#modal {
  207. #       auth_request /auth-admin;
  208.         proxy_pass https://10.0.0.11:8090/sabnzbd/#modal;
  209.         add_header X-Frame-Options SAMEORIGIN;
  210.         proxy_set_header Host $host;
  211.         proxy_set_header X-Real-IP $remote_addr;
  212.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  213.         }
  214.    
  215.     location /rss {
  216.         auth_request /auth-admin;
  217.         proxy_pass http://10.0.0.11:8585/rss;
  218.         proxy_set_header Host $host;
  219.         proxy_set_header X-Real-IP $remote_addr;
  220.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  221.         }
  222.  
  223.         location /nzbget {
  224.         auth_request /auth-admin;
  225.         proxy_pass http://10.0.0.11:6789;
  226.         proxy_set_header Host $host;
  227.         proxy_set_header X-Real-IP $remote_addr;
  228.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  229.         }
  230.        
  231.     location /hydra/ {
  232.         auth_request /auth-user;
  233.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  234.         proxy_pass http://10.0.0.11:8061/hydra/;
  235.         }
  236.    
  237.     location /sonarr {
  238.         auth_request /auth-admin;
  239.         proxy_pass        http://10.0.0.11:8989/sonarr;
  240.         add_header X-Frame-Options SAMEORIGIN;
  241.         proxy_set_header Host $host;
  242.         proxy_set_header X-Real-IP $remote_addr;
  243.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  244.         proxy_set_header Accept-Encoding "";
  245.         sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="//rawgit.com/iFelix18/Darkerr/master/darkerr.css"></head>';
  246.         sub_filter_once on;
  247.         }
  248.        
  249.     location /guacamole {
  250.         auth_request /auth-admin;
  251.         include /config/nginx/proxy.conf;
  252.         proxy_set_header Upgrade $http_upgrade;
  253.         proxy_set_header Connection "upgrade";
  254.         proxy_set_header Host $http_host;
  255.         proxy_set_header X-NginX-Proxy true;
  256.         proxy_pass http://10.0.0.11:1321;
  257.         }
  258.        
  259.        
  260.     location /cray {
  261.         auth_request /auth-admin;
  262.         proxy_pass        http://10.0.0.11:8888/cray;
  263.         add_header X-Frame-Options SAMEORIGIN;
  264.         proxy_set_header Host $host;
  265.         proxy_set_header X-Real-IP $remote_addr;
  266.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  267.         proxy_set_header Accept-Encoding "";
  268.         sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="//rawgit.com/iFelix18/Darkerr/master/darkerr.css"></head>';
  269.         sub_filter_once on;
  270.         }
  271.        
  272.     location /radarr {
  273.         auth_request /auth-admin;
  274.         proxy_pass        http://10.0.0.11:8787/radarr;
  275.         add_header X-Frame-Options SAMEORIGIN;
  276.         proxy_set_header Host $host;
  277.         proxy_set_header X-Real-IP $remote_addr;
  278.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  279.         proxy_set_header Accept-Encoding "";
  280.         sub_filter '</head>' '<link rel="stylesheet" type="text/css" href="//rawgit.com/iFelix18/Darkerr/master/darkerr.css"></head>';
  281.         sub_filter_once on;
  282.         }  
  283.  
  284.     location /tor {
  285.         return 301 /tor/;
  286.     }
  287.    
  288.     location /tor/ {
  289.         auth_request /auth-admin;
  290.         proxy_pass http://10.0.0.11:8060/tor/;
  291.         add_header X-Frame-Options SAMEORIGIN;
  292.         proxy_set_header Host $host;
  293.         proxy_set_header X-Real-IP $remote_addr;
  294.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  295.         proxy_set_header    X-Forwarded-Proto   $scheme;
  296.         proxy_set_header    X-Forwarded-Ssl     on;
  297.     }
  298.    
  299.     location /deluge {
  300.         auth_request /auth-admin;
  301.         proxy_pass        http://10.0.0.11:8112/;
  302.         proxy_set_header  X-Deluge-Base "/deluge/";
  303.         add_header X-Frame-Options SAMEORIGIN;
  304.     }
  305.    
  306.  
  307.    
  308.     location /plex/ {
  309.         proxy_pass http://plex-upstream/;
  310.         include proxy.conf;
  311.     }
  312.     if ($http_referer ~* /plex/) {
  313.         rewrite ^/web/(.*) /plex/web/$1? redirect;
  314.     }
  315. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement