biblioteca.conf 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. ## Configuração para biblioteca.partidopirata.org
  2. server {
  3. listen 80;
  4. listen [::]:80;
  5. server_name biblioteca.partidopirata.org;
  6. return 301 https://biblioteca.partidopirata.org$request_uri;
  7. }
  8. server {
  9. listen 80;
  10. listen [::]:80;
  11. server_name *.biblioteca.partidopirata.org;
  12. return 301 http://biblioteca.partidopirata.org$request_uri;
  13. }
  14. ## SSL
  15. server {
  16. listen 443 ssl;
  17. listen [::]:443 ssl;
  18. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  19. ssl_prefer_server_ciphers on;
  20. ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  21. ssl_ecdh_curve secp384r1;
  22. ssl_session_cache shared:SSL:10m;
  23. ssl_session_tickets off;
  24. ssl_stapling on;
  25. ssl_stapling_verify on;
  26. resolver 208.67.220.220 208.67.222.222 valid=300s;
  27. resolver_timeout 5s;
  28. add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
  29. add_header X-Frame-Options SAMEORIGIN;
  30. add_header X-Content-Type-Options nosniff;
  31. ssl_certificate /etc/letsencrypt/live/partidopirata.org-0001/fullchain.pem;
  32. ssl_certificate_key /etc/letsencrypt/live/partidopirata.org-0001/privkey.pem;
  33. ssl_trusted_certificate /etc/letsencrypt/live/partidopirata.org-0001/chain.pem;
  34. server_name biblioteca.partidopirata.org;
  35. #################################################
  36. # Stock useful config options, but ignore them :)
  37. #################################################
  38. include /etc/nginx/mime.types;
  39. autoindex off;
  40. default_type application/octet-stream;
  41. sendfile on;
  42. # Gzip
  43. gzip on;
  44. gzip_min_length 1024;
  45. gzip_buffers 4 32k;
  46. gzip_types text/plain application/x-javascript text/javascript text/xml text/css;
  47. #####################################
  48. # Mounting MediaGoblin stuff
  49. # This is the section you should read
  50. #####################################
  51. # Change this to update the upload size limit for your users
  52. client_max_body_size 1228M;
  53. client_body_timeout 360s;
  54. # prevent attacks (someone uploading a .txt file that the browser
  55. # interprets as an HTML file, etc.)
  56. add_header X-Content-Type-Options nosniff;
  57. # Log é o cacete
  58. #server_name mediagoblin.example.org www.mediagoblin.example.org;
  59. #access_log /var/log/nginx/mediagoblin.example.access.log;
  60. #error_log /var/log/nginx/mediagoblin.example.error.log;
  61. # MediaGoblin's stock static files: CSS, JS, etc.
  62. location /mgoblin_static/ {
  63. alias /home/biblioteca/mediagoblin/mediagoblin/static/;
  64. }
  65. # Instance specific media:
  66. location /mgoblin_media/ {
  67. alias /home/biblioteca/mediagoblin/user_dev/media/public/;
  68. }
  69. # Theme static files (usually symlinked in)
  70. location /theme_static/ {
  71. alias /home/biblioteca/mediagoblin/user_dev/theme_static/;
  72. }
  73. # Plugin static files (usually symlinked in)
  74. location /plugin_static/ {
  75. alias /home/biblioteca/mediagoblin/user_dev/plugin_static/;
  76. }
  77. # Mounting MediaGoblin itself via FastCGI.
  78. location / {
  79. fastcgi_pass 127.0.0.1:26543;
  80. include /etc/nginx/fastcgi_params;
  81. # our understanding vs nginx's handling of script_name vs
  82. # path_info don't match :)
  83. fastcgi_param PATH_INFO $fastcgi_script_name;
  84. fastcgi_param SCRIPT_NAME "";
  85. client_max_body_size 1228M;
  86. }
  87. }
  88. ## Tor
  89. server {
  90. listen 127.0.0.1:42908;
  91. allow 127.0.0.1;
  92. deny all;
  93. add_header X-Frame-Options SAMEORIGIN;
  94. add_header X-Content-Type-Options nosniff;
  95. server_name bibvznfpj46ymcwr.onion;
  96. #################################################
  97. # Stock useful config options, but ignore them :)
  98. #################################################
  99. include /etc/nginx/mime.types;
  100. autoindex off;
  101. default_type application/octet-stream;
  102. sendfile on;
  103. # Gzip
  104. gzip on;
  105. gzip_min_length 1024;
  106. gzip_buffers 4 32k;
  107. gzip_types text/plain application/x-javascript text/javascript text/xml text/css;
  108. #####################################
  109. # Mounting MediaGoblin stuff
  110. # This is the section you should read
  111. #####################################
  112. # Change this to update the upload size limit for your users
  113. client_max_body_size 1228M;
  114. client_body_timeout 360s;
  115. # prevent attacks (someone uploading a .txt file that the browser
  116. # interprets as an HTML file, etc.)
  117. add_header X-Content-Type-Options nosniff;
  118. # Log é o cacete
  119. #server_name mediagoblin.example.org www.mediagoblin.example.org;
  120. #access_log /var/log/nginx/mediagoblin.example.access.log;
  121. #error_log /var/log/nginx/mediagoblin.example.error.log;
  122. # MediaGoblin's stock static files: CSS, JS, etc.
  123. location /mgoblin_static/ {
  124. alias /home/biblioteca/mediagoblin/mediagoblin/static/;
  125. }
  126. # Instance specific media:
  127. location /mgoblin_media/ {
  128. alias /home/biblioteca/mediagoblin/user_dev/media/public/;
  129. }
  130. # Theme static files (usually symlinked in)
  131. location /theme_static/ {
  132. alias /home/biblioteca/mediagoblin/user_dev/theme_static/;
  133. }
  134. # Plugin static files (usually symlinked in)
  135. location /plugin_static/ {
  136. alias /home/biblioteca/mediagoblin/user_dev/plugin_static/;
  137. }
  138. # Mounting MediaGoblin itself via FastCGI.
  139. location / {
  140. fastcgi_pass 127.0.0.1:26543;
  141. include /etc/nginx/fastcgi_params;
  142. # our understanding vs nginx's handling of script_name vs
  143. # path_info don't match :)
  144. fastcgi_param PATH_INFO $fastcgi_script_name;
  145. fastcgi_param SCRIPT_NAME "";
  146. client_max_body_size 1228M;
  147. }
  148. }