cryptpad.conf 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13. # Default server configuration
  14. #
  15. map $http_upgrade $connection_upgrade {
  16. default upgrade;
  17. '' close;
  18. }
  19. upstream cryptpad {
  20. server cryptpad-service-dockerbunker:3000;
  21. }
  22. server {
  23. listen 80;
  24. server_name ${SERVICE_DOMAIN};
  25. return 301 https://$host$request_uri;
  26. }
  27. server {
  28. listen 443 ssl;
  29. server_name ${SERVICE_DOMAIN};
  30. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  31. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  32. include /etc/nginx/includes/ssl.conf;
  33. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  34. add_header X-Frame-Options SAMEORIGIN;
  35. add_header X-Content-Type-Options nosniff;
  36. include /etc/nginx/includes/gzip.conf;
  37. location / {
  38. proxy_pass http://cryptpad;
  39. proxy_set_header Host $http_host; # required for docker client's sake
  40. proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
  41. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  42. proxy_set_header X-Forwarded-Proto $scheme;
  43. proxy_read_timeout 900;
  44. }
  45. location /cryptpad_websocket {
  46. proxy_pass http://cryptpad/cryptpad_websocket;
  47. proxy_http_version 1.1;
  48. proxy_set_header Upgrade $http_upgrade;
  49. proxy_set_header Connection $connection_upgrade;
  50. }
  51. location ~ /.well-known {
  52. allow all;
  53. root /var/www/html;
  54. }
  55. }