ttrss 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ## YOURLS site config
  2. server {
  3. ## Redirect http to https
  4. listen 80;
  5. listen [::]:80;
  6. server_name tt.demu.red;
  7. return 301 https://$host$request_uri;
  8. }
  9. server {
  10. listen 443 ssl;
  11. listen [::]:443 ssl;
  12. server_name tt.demu.red;
  13. root /var/www/tt-rss;
  14. access_log /var/log/nginx/ttrss_access.log;
  15. error_log /var/log/nginx/ttrss_error.log;
  16. ## Disable all methods besides HEAD, GET and POST.
  17. if ($request_method !~ ^(GET|HEAD|POST)$ ) {
  18. return 444;
  19. }
  20. index index.php index.html;
  21. ## Include certbot fix
  22. include /etc/nginx/snippets/nginx.well-known.conf;
  23. ## Include ssl
  24. include /etc/nginx/snippets/nginx.ssl.conf;
  25. ### Deny Stuffs ### {{{
  26. ## Protect specific TXT and config files
  27. location ~ /(\.|readme.html|readme.md|changelog.txt|changelog.md|contributing.txt|contributing.md|license.txt|license.md|legalnotice|privacy.txt|privacy.md|security.txt|security.md|sample-.*txt)
  28. {
  29. deny all;
  30. }
  31. ## Protect .git files
  32. location ~ /\.git/ {
  33. access_log off;
  34. log_not_found off;
  35. deny all;
  36. }
  37. ### End Deny Stuffs ### }}}
  38. location / {
  39. access_log /var/log/nginx/ttrss_access.log;
  40. error_log /var/log/nginx/ttrss_error.log info;
  41. #location ~ /(js|css|images|lib|themes) {
  42. #access_log off;
  43. #}
  44. location ~ ^(.+\.php)(.*)$ {
  45. fastcgi_split_path_info ^(.+\.php)(.*)$;
  46. try_files $uri =404;
  47. fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  48. fastcgi_index index.php;
  49. ## https://stackoverflow.com/questions/28490391/how-to-properly-configure-alias-directive-in-nginx
  50. fastcgi_param SCRIPT_FILENAME $request_filename;
  51. include fastcgi_params;
  52. }
  53. }
  54. ## Error Redirects
  55. error_page 403 /error.html;
  56. error_page 404 /error.html;
  57. error_page 405 /error.html;
  58. error_page 500 501 502 503 504 /error.html;
  59. location = /error.html {
  60. root /var/www/error;
  61. internal;
  62. }
  63. }