default.conf 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. server {
  2. listen 80 default_server;
  3. listen [::]:80 default_server;
  4. listen 443 ssl http2 default_server;
  5. listen [::]:443 ssl http2 default_server;
  6. # SSL configuration
  7. # SSL cert/key files
  8. ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
  9. ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
  10. # For production regenerate this dhparam key by running:
  11. # $> openssl dhparam -out dhparam.pem 4096
  12. ssl_dhparam /etc/ssl/private/dhparam.pem;
  13. # SSL ciphers/protocols
  14. ssl_protocols TLSv1.3 TLSv1.2;
  15. ssl_prefer_server_ciphers on;
  16. ssl_ecdh_curve secp521r1:secp384r1;
  17. ssl_ciphers EECDH+AESGCM:EECDH+AES256;
  18. # SSL misc
  19. ssl_session_cache shared:TLS:2m;
  20. ssl_buffer_size 4k;
  21. # OCSP stapling
  22. ssl_stapling on;
  23. ssl_stapling_verify on;
  24. resolver 1.1.1.1 1.0.0.1 [2606:4700:4700::1111] [2606:4700:4700::1001]; # Cloudflare
  25. # Set HSTS to 365 days
  26. # Note: Activate this on production usage
  27. #add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload' always;
  28. location /.well-known/webfinger {
  29. proxy_http_version 1.1;
  30. proxy_set_header Upgrade $http_upgrade;
  31. proxy_set_header Connection "upgrade";
  32. proxy_redirect off;
  33. proxy_connect_timeout 90;
  34. proxy_send_timeout 90;
  35. proxy_read_timeout 90;
  36. proxy_set_header Host $host;
  37. proxy_set_header X-Real-IP $remote_addr;
  38. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  39. proxy_set_header X-Forwarded-Proto $scheme;
  40. proxy_set_header Proxy "";
  41. proxy_pass_header Server;
  42. proxy_buffering on;
  43. tcp_nodelay on;
  44. proxy_pass http://snac:8001;
  45. proxy_set_header Host $http_host;
  46. }
  47. location /.well-known/nodeinfo {
  48. proxy_http_version 1.1;
  49. proxy_set_header Upgrade $http_upgrade;
  50. proxy_set_header Connection "upgrade";
  51. proxy_redirect off;
  52. proxy_connect_timeout 90;
  53. proxy_send_timeout 90;
  54. proxy_read_timeout 90;
  55. proxy_set_header Host $host;
  56. proxy_set_header X-Real-IP $remote_addr;
  57. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  58. proxy_set_header X-Forwarded-Proto $scheme;
  59. proxy_set_header Proxy "";
  60. proxy_pass_header Server;
  61. proxy_buffering on;
  62. tcp_nodelay on;
  63. proxy_pass http://snac:8001;
  64. proxy_set_header Host $http_host;
  65. }
  66. location / {
  67. proxy_http_version 1.1;
  68. proxy_set_header Upgrade $http_upgrade;
  69. proxy_set_header Connection "upgrade";
  70. proxy_redirect off;
  71. proxy_connect_timeout 90;
  72. proxy_send_timeout 90;
  73. proxy_read_timeout 90;
  74. proxy_set_header Host $host;
  75. proxy_set_header X-Real-IP $remote_addr;
  76. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  77. proxy_set_header X-Forwarded-Proto $scheme;
  78. proxy_set_header Proxy "";
  79. proxy_pass_header Server;
  80. proxy_buffering on;
  81. tcp_nodelay on;
  82. proxy_pass http://snac:8001;
  83. proxy_set_header Host $http_host;
  84. }
  85. location /fedi/ {
  86. proxy_http_version 1.1;
  87. proxy_set_header Upgrade $http_upgrade;
  88. proxy_set_header Connection "upgrade";
  89. proxy_redirect off;
  90. proxy_connect_timeout 90;
  91. proxy_send_timeout 90;
  92. proxy_read_timeout 90;
  93. proxy_set_header Host $host;
  94. proxy_set_header X-Real-IP $remote_addr;
  95. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  96. proxy_set_header X-Forwarded-Proto $scheme;
  97. proxy_set_header Proxy "";
  98. proxy_pass_header Server;
  99. proxy_buffering on;
  100. tcp_nodelay on;
  101. proxy_pass http://snac:8001;
  102. proxy_set_header Host $http_host;
  103. }
  104. }