searxng.ini:socket 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 = ${SEARX_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 = ${SEARX_PYENV}
  44. # add directory (or glob) to pythonpath
  45. pythonpath = ${SEARX_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 = ${SEARX_INTERNAL_HTTP}
  56. # using unix-sockets:
  57. #
  58. # On some distributions you need to create the app folder for the sockets::
  59. #
  60. # mkdir -p ${SEARX_UWSGI_SOCKET}
  61. # chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
  62. #
  63. socket = ${SEARX_UWSGI_SOCKET}
  64. # uwsgi serves the static files
  65. # expires set to one year since there are hashes
  66. static-map = /static=${SEARX_SRC}/searx/static
  67. static-expires = /* 31557600
  68. static-gzip-all = True
  69. offload-threads = %k
  70. # Cache
  71. cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1