Advertisement
Nodiaque

default.conf

Jun 10th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. ## Version 2023/06/05 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/site-confs/default.conf.sample
  2.  
  3. # redirect all traffic to https
  4. server {
  5. listen 80 default_server;
  6. listen [::]:80 default_server;
  7.  
  8. location / {
  9. return 301 https://$host$request_uri;
  10. }
  11. }
  12.  
  13. # main server block
  14. server {
  15. listen 443 ssl http2 default_server;
  16. listen [::]:443 ssl http2 default_server;
  17.  
  18. server_name _;
  19.  
  20. include /config/nginx/ssl.conf;
  21.  
  22. root /config/www;
  23. index index.html index.htm index.php;
  24.  
  25. # enable subfolder method reverse proxy confs
  26. include /config/nginx/proxy-confs/*.subfolder.conf;
  27.  
  28. # enable for ldap auth (requires ldap-location.conf in the location block)
  29. #include /config/nginx/ldap-server.conf;
  30.  
  31. # enable for Authelia (requires authelia-location.conf in the location block)
  32. include /config/nginx/authelia-server.conf;
  33.  
  34. # enable for Authentik (requires authentik-location.conf in the location block)
  35. #include /config/nginx/authentik-server.conf;
  36.  
  37. # display real ip in nginx logs when connected through reverse proxy via docker network
  38. set_real_ip_from 192.168.0.0/16;
  39. real_ip_header X-Forwarded-For;
  40.  
  41. location / {
  42. # enable for basic auth
  43. #auth_basic "Restricted";
  44. #auth_basic_user_file /config/nginx/.htpasswd;
  45.  
  46. # enable for ldap auth (requires ldap-server.conf in the server block)
  47. #include /config/nginx/ldap-location.conf;
  48.  
  49. # enable for Authelia (requires authelia-server.conf in the server block)
  50. include /config/nginx/authelia-location.conf;
  51.  
  52. # enable for Authentik (requires authentik-server.conf in the server block)
  53. #include /config/nginx/authentik-location.conf;
  54.  
  55. try_files $uri $uri/ /index.html /index.php$is_args$args =404;
  56. }
  57.  
  58. location ~ ^(.+\.php)(.*)$ {
  59. # enable the next two lines for http auth
  60. #auth_basic "Restricted";
  61. #auth_basic_user_file /config/nginx/.htpasswd;
  62.  
  63. # enable for ldap auth (requires ldap-server.conf in the server block)
  64. #include /config/nginx/ldap-location.conf;
  65.  
  66. # enable for Authelia (requires authelia-server.conf in the server block)
  67. include /config/nginx/authelia-location.conf;
  68.  
  69. # enable for Authentik (requires authentik-server.conf in the server block)
  70. #include /config/nginx/authentik-location.conf;
  71.  
  72. fastcgi_split_path_info ^(.+\.php)(.*)$;
  73. fastcgi_pass 127.0.0.1:9000;
  74. fastcgi_index index.php;
  75. include /etc/nginx/fastcgi_params;
  76. }
  77.  
  78. # deny access to .htaccess/.htpasswd files
  79. location ~ /\.ht {
  80. deny all;
  81. }
  82. }
  83.  
  84. # enable subdomain method reverse proxy confs
  85. include /config/nginx/proxy-confs/*.subdomain.conf;
  86. # enable proxy cache for auth
  87. proxy_cache_path cache/ keys_zone=auth_cache:10m;
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement