From 96b86125d9bcfd0042aa1f5de2f255429e0dfded Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:14:31 +0100 Subject: [PATCH] some fixes --- conf/nginx.conf | 43 ++++++++++++++++++++----------------------- conf/uwsgi.ini | 9 ++------- 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index dbdc8ae..c84a5fe 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,32 +1,29 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; # https://github.com/WeblateOrg/weblate/blob/master/weblate/examples/weblate.nginx.conf -location = __PATH__/favicon.ico { - alias __INSTALL_DIR__/data/static/favicon.ico; - expires 30d; -} + location ~ ^__PATH__/favicon.ico$ { -location = __PATH__/robots.txt { - alias __INSTALL_DIR__/data/static/robots.txt; - expires 30d; -} + alias __INSTALL_DIR__/data/cache/static/favicon.ico; + expires 30d; + } -location __PATH__/static/ { - alias __INSTALL_DIR__/data/static/; - expires 30d; -} + location __PATH__/static/ { + alias __INSTALL_DIR__/data/cache/static/; + expires 30d; + } -location __PATH__/media/ { - alias __INSTALL_DIR__/data/media/; - expires 30d; -} + location __PATH__/media/ { + alias __INSTALL_DIR__/data/media/; + expires 30d; + } -location __PATH__/ { - alias __INSTALL_DIR__/ ; - - include uwsgi_params; - # Needed for long running operations in admin interface - uwsgi_read_timeout 3600; - uwsgi_pass 127.0.0.1:__PORT__; + location __PATH__/ { + include uwsgi_params; + # Needed for long running operations in admin interface + uwsgi_read_timeout 3600; + # Adjust based to uwsgi configuration: + uwsgi_pass unix:///run/uwsgi/app/weblate/socket; + # uwsgi_pass 127.0.0.1:8080; + # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/conf/uwsgi.ini b/conf/uwsgi.ini index e7a5225..6019dbf 100644 --- a/conf/uwsgi.ini +++ b/conf/uwsgi.ini @@ -2,12 +2,9 @@ plugins = python3 master = true protocol = uwsgi -socket = 127.0.0.1:__PORT__ +socket = 127.0.0.1:8080 wsgi-file = __INSTALL_DIR__/venv/lib/__WEBLATE_PYPATH__/site-packages/weblate/wsgi.py -# http://uwsgi-docs.readthedocs.io/en/latest/Nginx.html#hosting-multiple-apps-in-the-same-process-aka-managing-script-name-and-path-info -#mount = __PATH__=__INSTALL_DIR__/venv/lib/__WEBLATE_PYPATH__/site-packages/weblate/wsgi.py - # Add path to Weblate checkout if you did not install # Weblate by pip # python-path = /path/to/weblate @@ -37,8 +34,6 @@ umask = 0022 uid = __APP__ gid = __APP__ -chmod-socket = 666 - # Enable harakiri mode (kill requests after some time) # harakiri = 3600 # harakiri-verbose = true @@ -50,4 +45,4 @@ chmod-socket = 666 # Do not log some errors caused by client disconnects ignore-sigpipe = true ignore-write-errors = true -disable-write-exception = true +disable-write-exception = true \ No newline at end of file