nginx.conf 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # See: https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/
  2. # https://medium.com/@shrikeh/setting-up-nginx-and-php-fpm-in-docker-with-unix-sockets-6fdfbdc19f91
  3. upstream _php {
  4. server unix:/socks/php.socket;
  5. }
  6. server {
  7. listen 80;
  8. more_set_headers "Server: kickass";
  9. server_tokens off;
  10. # server_name ;
  11. root /usr/share/nginx/html;
  12. index index.html index.php;
  13. # set expiration of assets
  14. location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
  15. expires 14d;
  16. log_not_found off;
  17. }
  18. # location / {
  19. # # check if a file or directory
  20. # try_files $uri $uri/ /index.php;
  21. # }
  22. # location ~ ^/(index|load|api|thumb|opensearch_desc)\.php$ {
  23. location ~* \.php$ {
  24. # fastcgi_pass php:9000;
  25. # include fastcgi.conf;
  26. fastcgi_pass _php;
  27. include fastcgi.conf;
  28. fastcgi_hide_header X-Powered-By;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30. # or possibly include fastcgi_params; ?
  31. }
  32. location ~ ^/resources/(assets|lib|src) {
  33. try_files $uri 404;
  34. add_header Cache-Control "public";
  35. expires 1d;
  36. }
  37. location ~ ^/(skins|extensions).+.(css|js|gif|jpg|jpeg|png|svg)$ {
  38. try_files $uri 404;
  39. add_header Cache-Control "public";
  40. expires 1d;
  41. }
  42. # location = /favicon.ico {
  43. # alias /images/6/64/Favicon.ico;
  44. # # add_header Cache-Control "public";
  45. # # expires 1d;
  46. # }
  47. # location /wiki/ {
  48. # rewrite ^/wiki/(?<pagename>.*)$ /index.php;
  49. # }
  50. }