AlphaOmega2020

default.conf

Dec 2nd, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. ## Version 2025/07/18 - 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 default_server;
  16. # listen 443 quic reuseport default_server;
  17. listen [::]:443 ssl default_server;
  18. # listen [::]:443 quic reuseport default_server;
  19.  
  20. server_name _;
  21.  
  22. # === START: REAL IP MODULE CONFIGURATION ===
  23. # Tells NGINX to look at the 'X-Forwarded-For' header for the real client IP.
  24. real_ip_header X-Forwarded-For;
  25.  
  26. # IMPORTANT: Define the IP range(s) of your *trusted* upstream proxy/load balancer.
  27. # ONLY traffic from these IPs will have their IP replaced.
  28. # Replace these examples with your actual addresses.
  29. set_real_ip_from 192.168.1.1/32; # Example: IP of your router or firewall
  30. set_real_ip_from 172.16.0.0/12; # Example: A common range for Docker networks
  31. set_real_ip_from 10.0.0.0/16; # Example: A common range for Docker networks
  32. # === END: REAL IP MODULE CONFIGURATION ===
  33.  
  34. include /config/nginx/ssl.conf;
  35.  
  36. root /config/www;
  37. index index.html index.htm index.php;
  38.  
  39. # enable subfolder method reverse proxy confs
  40. include /config/nginx/proxy-confs/*.subfolder.conf;
  41.  
  42. # enable for ldap auth (requires ldap-location.conf in the location block)
  43. #include /config/nginx/ldap-server.conf;
  44.  
  45. # enable for Authelia (requires authelia-location.conf in the location block)
  46. #include /config/nginx/authelia-server.conf;
  47.  
  48. # enable for Authentik (requires authentik-location.conf in the location block)
  49. #include /config/nginx/authentik-server.conf;
  50.  
  51. location / {
  52. # enable for basic auth
  53. #auth_basic "Restricted";
  54. #auth_basic_user_file /config/nginx/.htpasswd;
  55.  
  56. # enable for ldap auth (requires ldap-server.conf in the server block)
  57. #include /config/nginx/ldap-location.conf;
  58.  
  59. # enable for Authelia (requires authelia-server.conf in the server block)
  60. #include /config/nginx/authelia-location.conf;
  61.  
  62. # enable for Authentik (requires authentik-server.conf in the server block)
  63. #include /config/nginx/authentik-location.conf;
  64.  
  65. try_files $uri $uri/ /index.html /index.htm /index.php$is_args$args;
  66. }
  67.  
  68. location ~ ^(.+\.php)(.*)$ {
  69. # enable the next two lines for http auth
  70. #auth_basic "Restricted";
  71. #auth_basic_user_file /config/nginx/.htpasswd;
  72.  
  73. # enable for ldap auth (requires ldap-server.conf in the server block)
  74. #include /config/nginx/ldap-location.conf;
  75.  
  76. # enable for Authelia (requires authelia-server.conf in the server block)
  77. #include /config/nginx/authelia-location.conf;
  78.  
  79. # enable for Authentik (requires authentik-server.conf in the server block)
  80. #include /config/nginx/authentik-location.conf;
  81.  
  82. fastcgi_split_path_info ^(.+\.php)(.*)$;
  83. if (!-f $document_root$fastcgi_script_name) { return 404; }
  84. fastcgi_pass 127.0.0.1:9000;
  85. fastcgi_index index.php;
  86. include /etc/nginx/fastcgi_params;
  87. }
  88.  
  89. # deny access to .htaccess/.htpasswd files
  90. location ~ /\.ht {
  91. deny all;
  92. }
  93. }
  94.  
  95. # enable subdomain method reverse proxy confs
  96. include /config/nginx/proxy-confs/*.subdomain.conf;
  97.  
  98.  
Advertisement
Add Comment
Please, Sign In to add comment