searxng.ini:socket 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # -*- mode: conf; coding: utf-8 -*-
  2. [uwsgi]
  3. # uWSGI core
  4. # ----------
  5. #
  6. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
  7. # Who will run the code
  8. uid = ${SERVICE_USER}
  9. gid = ${SERVICE_GROUP}
  10. # set (python) default encoding UTF-8
  11. env = LANG=C.UTF-8
  12. env = LANGUAGE=C.UTF-8
  13. env = LC_ALL=C.UTF-8
  14. # chdir to specified directory before apps loading
  15. chdir = ${SEARXNG_SRC}/searx
  16. # SearXNG configuration (settings.yml)
  17. env = SEARXNG_SETTINGS_PATH=${SEARXNG_SETTINGS_PATH}
  18. # disable logging for privacy
  19. disable-logging = true
  20. # The right granted on the created socket
  21. chmod-socket = 666
  22. # Plugin to use and interpretor config
  23. single-interpreter = true
  24. # enable master process
  25. master = true
  26. # load apps in each worker instead of the master
  27. lazy-apps = true
  28. # load uWSGI plugins
  29. plugin = python3,http
  30. # By default the Python plugin does not initialize the GIL. This means your
  31. # app-generated threads will not run. If you need threads, remember to enable
  32. # them with enable-threads. Running uWSGI in multithreading mode (with the
  33. # threads options) will automatically enable threading support. This *strange*
  34. # default behaviour is for performance reasons.
  35. enable-threads = true
  36. # plugin: python
  37. # --------------
  38. #
  39. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
  40. # load a WSGI module
  41. module = searx.webapp
  42. # set PYTHONHOME/virtualenv
  43. virtualenv = ${SEARXNG_PYENV}
  44. # add directory (or glob) to pythonpath
  45. pythonpath = ${SEARXNG_SRC}
  46. # speak to upstream
  47. # -----------------
  48. #
  49. # Activate the 'http' configuration for filtron or activate the 'socket'
  50. # configuration if you setup your HTTP server to use uWSGI protocol via sockets.
  51. # using IP:
  52. #
  53. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http
  54. # Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
  55. # http = ${SEARXNG_INTERNAL_HTTP}
  56. # using unix-sockets:
  57. #
  58. # Don't forget to create the folder where the sockets should take place::
  59. #
  60. # mkdir -p "$(dirname ${SEARXNG_UWSGI_SOCKET})"
  61. # chown -R "${SERVICE_USER}:${SERVICE_GROUP}" "$(dirname ${SEARXNG_UWSGI_SOCKET})"
  62. #
  63. socket = ${SEARXNG_UWSGI_SOCKET}
  64. # uWSGI serves the static files and in settings.yml we use::
  65. #
  66. # ui:
  67. # static_use_hash: true
  68. #
  69. static-map = /static=${SEARXNG_STATIC}
  70. # expires set to one year since there are hashes
  71. static-expires = /* 31557600
  72. static-gzip-all = True
  73. offload-threads = %k
  74. # Cache
  75. cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1