Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

friendica-nginx.conf 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ##
  2. # Friendica Nginx configuration
  3. # by Pawlik
  4. #
  5. # On Debian based distributions you can add this file to
  6. # /etc/nginx/sites-available
  7. #
  8. # Then customize to your needs. To enable the configuration
  9. # symlink it to /etc/nginx/sites-enabled and reload Nginx
  10. # using /etc/init.d/nginx reload
  11. ##
  12. ##
  13. # You should look at the following URL's in order to grasp a solid understanding
  14. # of Nginx configuration files in order to fully unleash the power of Nginx.
  15. #
  16. # http://wiki.nginx.org/Pitfalls
  17. # http://wiki.nginx.org/QuickStart
  18. # http://wiki.nginx.org/Configuration
  19. ##
  20. ##
  21. # This configuration assumes your domain is example.net
  22. # You have a separate subdomain friendica.example.net
  23. # You want all friendica traffic to be https
  24. # You have an SSL certificate and key for your subdomain
  25. # You have PHP FastCGI Process Manager (php7-fpm) running on localhost
  26. # You have Friendica installed in /mnt/friendica/www
  27. ##
  28. server {
  29. server_name ixyz.com;
  30. index index.php;
  31. root /home/root/friendica;
  32. rewrite ^ https://xyz.com$request_uri? permanent;
  33. }
  34. ##
  35. # Configure Friendica with SSL
  36. #
  37. # All requests are routed to the front controller
  38. # except for certain known file types like images, css, etc.
  39. # Those are served statically whenever possible with a
  40. # fall back to the front controller (needed for avatars, for example)
  41. ##
  42. server {
  43. listen 443 ssl;
  44. listen [::]:443 ssl;
  45. server_name xyz.com
  46. index index.php;
  47. root /home/root/friendica;
  48. ssl on;
  49. ssl_certificate /etc/nginx/ssl/friendica.example.net.chain.pem;
  50. ssl_certificate_key /etc/nginx/ssl/example.net.key;
  51. ssl_session_timeout 5m;
  52. ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
  53. ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  54. ssl_prefer_server_ciphers on;
  55. fastcgi_param HTTPS on;
  56. # allow uploads up to 20MB in size
  57. client_max_body_size 20m;
  58. client_body_buffer_size 128k;
  59. # rewrite to front controller as default rule
  60. location / {
  61. rewrite ^/(.*) /index.php?q=$uri&$args last;
  62. }
  63. # make sure webfinger and other well known services aren't blocked
  64. # by denying dot files and rewrite request to the front controller
  65. location ^~ /.well-known/ {
  66. allow all;
  67. rewrite ^/(.*) /index.php?q=$uri&$args last;
  68. }
  69. include mime.types;
  70. # statically serve these file types when possible
  71. # otherwise fall back to front controller
  72. # allow browser to cache them
  73. # added .htm for advanced source code editor library
  74. location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|ttf|svg)$ {
  75. expires 30d;
  76. try_files $uri /index.php?q=$uri&$args;
  77. }
  78. # block these file types
  79. location ~* \.(tpl|md|tgz|log|out)$ {
  80. deny all;
  81. }
  82. location ~ [^/]\.php(/|$) {
  83. try_files $uri =404;
  84. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  85. # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  86. fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
  87. include fastcgi_params;
  88. fastcgi_index index.php;
  89. # fastcgi_param PATH_INFO $fastcgi_path_info;
  90. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  91. fastcgi_buffers 16 16k;
  92. fastcgi_buffer_size 32k;
  93. }
  94. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  95. # location ~* \.php$ {
  96. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  97. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  98. # With php5-cgi alone:
  99. # fastcgi_pass 127.0.0.1:9000;
  100. # With php5-fpm:
  101. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  102. # fastcgi_index index.php;
  103. # include fastcgi_params;
  104. # }
  105. # deny access to all dot files
  106. location ~ /\. {
  107. deny all;
  108. }
  109. }