Advertisement
CptnAgua

Calibre SWAG conf

Jun 28th, 2021
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 7.26 KB | None | 0 0
  1. ##################################################################################
  2. ###########################   calibre.subfolder.conf   ###########################
  3. ##################################################################################
  4. ## Version 2021/05/18
  5. # calibre does not require a base url setting
  6.  
  7. location /calibre {
  8.     return 301 $scheme://$host/calibre/;
  9. }
  10.  
  11. location ^~ /calibre/ {
  12.     # enable the next two lines for http auth
  13.     #auth_basic "Restricted";
  14.     #auth_basic_user_file /config/nginx/.htpasswd;
  15.  
  16.     # enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf
  17.     #auth_request /auth;
  18.     #error_page 401 =200 /ldaplogin;
  19.  
  20.     # enable for Authelia, also enable authelia-server.conf in the default site config
  21.     #include /config/nginx/authelia-location.conf;
  22.  
  23.     include /config/nginx/proxy.conf;
  24.     include /config/nginx/resolver.conf;
  25.     set $upstream_app X.X.X.X;
  26.     set $upstream_port YYYYY;
  27.     set $upstream_proto http;
  28.     proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  29.  
  30.     #rewrite /calibre(.*) $1 break;
  31. }
  32.  
  33. ##################################################################################
  34. #################################   default   ####################################
  35. ##################################################################################
  36.  
  37. ## Version 2021/04/27 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/default
  38.  
  39. error_page 502 /502.html;
  40.  
  41. # redirect all traffic to https
  42. server {
  43.     listen 80 default_server;
  44.     listen [::]:80 default_server;
  45.     server_name _;
  46.     return 301 https://$host$request_uri;
  47. }
  48.  
  49. # main server block
  50. server {
  51.     listen 443 ssl http2 default_server;
  52.     listen [::]:443 ssl http2 default_server;
  53.  
  54.     root /config/www;
  55.     index index.html index.htm index.php;
  56.  
  57.     server_name _;
  58.  
  59.     # enable subfolder method reverse proxy confs
  60.     include /config/nginx/proxy-confs/*.subfolder.conf;
  61.  
  62.     # all ssl related config moved to ssl.conf
  63.     include /config/nginx/ssl.conf;
  64.  
  65.     # enable for ldap auth
  66.     #include /config/nginx/ldap.conf;
  67.  
  68.     # enable for Authelia
  69.     #include /config/nginx/authelia-server.conf;
  70.  
  71.     # enable for geo blocking
  72.     # See /config/nginx/geoip2.conf for more information.
  73.     #if ($allowed_country = no) {
  74.     #return 444;
  75.     #}
  76.  
  77.     add_header X-Content-Type-Options nosniff;
  78.     add_header X-XSS-Protection "1; mode=block";
  79.     add_header X-Robots-Tag none;
  80.     add_header X-Download-Options noopen;
  81.     add_header X-Permitted-Cross-Domain-Policies none;
  82.     add_header X-Frame-Options SAMEORIGIN;
  83.     auth_basic                  "Restricted Access!";
  84.     auth_basic_user_file        /config/security_htpasswd;
  85.    
  86.     location = /.well-known/carddav {
  87.       return 301 $scheme://$host/nextcloud/remote.php/dav;
  88.     }
  89.     location = /.well-known/caldav {
  90.       return 301 $scheme://$host/nextcloud/remote.php/dav;
  91.     }
  92.  
  93.     location ^~ /.well-known/acme-challenge/ {
  94.         auth_basic off;
  95.         auth_request off;
  96.         allow all;
  97.         root /usr/share/nginx/html;
  98.         try_files $uri =404;
  99.         break;
  100.     }
  101.  
  102.     client_max_body_size 0;
  103.  
  104.     location / {
  105.         # enable the next two lines for http auth
  106.         #auth_basic "Restricted";
  107.         #auth_basic_user_file /config/nginx/.htpasswd;
  108.  
  109.         # enable the next two lines for ldap auth
  110.         #auth_request /auth;
  111.         #error_page 401 =200 /ldaplogin;
  112.  
  113.         # enable for Authelia
  114.         #include /config/nginx/authelia-location.conf;
  115.  
  116.         try_files $uri $uri/ /index.html /index.php?$args =404;
  117.     }
  118.  
  119.     location ~ \.php$ {
  120.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  121.         fastcgi_pass 127.0.0.1:9000;
  122.         fastcgi_index index.php;
  123.         include /etc/nginx/fastcgi_params;
  124.     }
  125.  
  126. # sample reverse proxy config for password protected couchpotato running at IP 192.168.1.50 port 5050 with base url "cp"
  127. # notice this is within the same server block as the base
  128. # don't forget to generate the .htpasswd file as described on docker hub
  129. #    location ^~ /cp {
  130. #        auth_basic "Restricted";
  131. #        auth_basic_user_file /config/nginx/.htpasswd;
  132. #        include /config/nginx/proxy.conf;
  133. #        proxy_pass http://192.168.1.50:5050/cp;
  134. #    }
  135.  
  136. }
  137.  
  138. # sample reverse proxy config without url base, but as a subdomain "cp", ip and port same as above
  139. # notice this is a new server block, you need a new server block for each subdomain
  140. #server {
  141. #    listen 443 ssl http2;
  142. #    listen [::]:443 ssl http2;
  143. #
  144. #    root /config/www;
  145. #    index index.html index.htm index.php;
  146. #
  147. #    server_name cp.*;
  148. #
  149. #    include /config/nginx/ssl.conf;
  150. #
  151. #    client_max_body_size 0;
  152. #
  153. #    location / {
  154. #        auth_basic "Restricted";
  155. #        auth_basic_user_file /config/nginx/.htpasswd;
  156. #        include /config/nginx/proxy.conf;
  157. #        proxy_pass http://192.168.1.50:5050;
  158. #    }
  159. #}
  160.  
  161. # sample reverse proxy config for "heimdall" via subdomain, with ldap authentication
  162. # ldap-auth container has to be running and the /config/nginx/ldap.conf file should be filled with ldap info
  163. # notice this is a new server block, you need a new server block for each subdomain
  164. #server {
  165. #    listen 443 ssl http2;
  166. #    listen [::]:443 ssl http2;
  167. #
  168. #    root /config/www;
  169. #    index index.html index.htm index.php;
  170. #
  171. #    server_name heimdall.*;
  172. #
  173. #    include /config/nginx/ssl.conf;
  174. #
  175. #    include /config/nginx/ldap.conf;
  176. #
  177. #    client_max_body_size 0;
  178. #
  179. #    location / {
  180. #        # the next two lines will enable ldap auth along with the included ldap.conf in the server block
  181. #        auth_request /auth;
  182. #        error_page 401 =200 /ldaplogin;
  183. #
  184. #        include /config/nginx/proxy.conf;
  185. #        resolver 127.0.0.11 valid=30s;
  186. #        set $upstream_app heimdall;
  187. #        set $upstream_port 443;
  188. #        set $upstream_proto https;
  189. #        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  190. #    }
  191. #}
  192.  
  193. # sample reverse proxy config for "heimdall" via subdomain, with Authelia
  194. # Authelia container has to be running in the same user defined bridge network, with container name "authelia", and with 'path: "authelia"' set in its configuration.yml
  195. # notice this is a new server block, you need a new server block for each subdomain
  196. #server {
  197. #    listen 443 ssl http2;
  198. #    listen [::]:443 ssl http2;
  199. #
  200. #    root /config/www;
  201. #    index index.html index.htm index.php;
  202. #
  203. #    server_name heimdall.*;
  204. #
  205. #    include /config/nginx/ssl.conf;
  206. #
  207. #    include /config/nginx/authelia-server.conf;
  208. #
  209. #    client_max_body_size 0;
  210. #
  211. #    location / {
  212. #        # the next line will enable Authelia along with the included authelia-server.conf in the server block
  213. #        include /config/nginx/authelia-location.conf;
  214. #
  215. #        include /config/nginx/proxy.conf;
  216. #        resolver 127.0.0.11 valid=30s;
  217. #        set $upstream_app heimdall;
  218. #        set $upstream_port 443;
  219. #        set $upstream_proto https;
  220. #        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  221. #    }
  222. #}
  223.  
  224. # enable subdomain method reverse proxy confs
  225. include /config/nginx/proxy-confs/*.subdomain.conf;
  226. # enable proxy cache for auth
  227. proxy_cache_path cache/ keys_zone=auth_cache:10m;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement