portainer.subdomain.conf 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ## Version 2020/12/09
  2. # make sure that your dns has a cname set for portainer
  3. server {
  4. listen 443 ssl;
  5. listen [::]:443 ssl;
  6. server_name portainer.*;
  7. include /config/nginx/ssl.conf;
  8. client_max_body_size 0;
  9. # enable for ldap auth, fill in ldap details in ldap.conf
  10. #include /config/nginx/ldap.conf;
  11. # enable for Authelia
  12. #include /config/nginx/authelia-server.conf;
  13. location / {
  14. # enable the next two lines for http auth
  15. #auth_basic "Restricted";
  16. #auth_basic_user_file /config/nginx/.htpasswd;
  17. # enable the next two lines for ldap auth
  18. #auth_request /auth;
  19. #error_page 401 =200 /ldaplogin;
  20. # enable for Authelia
  21. #include /config/nginx/authelia-location.conf;
  22. include /config/nginx/proxy.conf;
  23. resolver 127.0.0.11 valid=30s;
  24. set $upstream_app portainer;
  25. set $upstream_port 9000;
  26. set $upstream_proto http;
  27. proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  28. proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
  29. }
  30. location /api/websocket/ {
  31. # enable the next two lines for http auth
  32. #auth_basic "Restricted";
  33. #auth_basic_user_file /config/nginx/.htpasswd;
  34. # enable the next two lines for ldap auth
  35. #auth_request /auth;
  36. #error_page 401 =200 /ldaplogin;
  37. # enable for Authelia
  38. #include /config/nginx/authelia-location.conf;
  39. include /config/nginx/proxy.conf;
  40. resolver 127.0.0.11 valid=30s;
  41. set $upstream_app portainer;
  42. set $upstream_port 9000;
  43. set $upstream_proto http;
  44. proxy_pass $upstream_proto://$upstream_app:$upstream_port;
  45. proxy_hide_header X-Frame-Options; # Possibly not needed after Portainer 1.20.0
  46. }
  47. }