cryptpad.conf 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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;
  29. server_name ${SERVICE_DOMAIN};
  30. ssl on;
  31. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  32. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  33. include /etc/nginx/includes/ssl.conf;
  34. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  35. add_header X-Frame-Options SAMEORIGIN;
  36. add_header X-Content-Type-Options nosniff;
  37. include /etc/nginx/includes/gzip.conf;
  38. location / {
  39. proxy_pass http://cryptpad;
  40. proxy_set_header Host $http_host; # required for docker client's sake
  41. proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
  42. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43. proxy_set_header X-Forwarded-Proto $scheme;
  44. proxy_read_timeout 900;
  45. }
  46. location /cryptpad_websocket {
  47. proxy_pass http://cryptpad/cryptpad_websocket;
  48. proxy_http_version 1.1;
  49. proxy_set_header Upgrade $http_upgrade;
  50. proxy_set_header Connection $connection_upgrade;
  51. }
  52. location ~ /.well-known {
  53. allow all;
  54. root /var/www/html;
  55. }
  56. }