forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: improve reverse proxy documentation
- clarify when REMOTE_ADDR is not available - log an error when IP address cannot be obtained with link to the documentation - add gunicorn/nginx example - document starting gunicorn See also WeblateOrg#13325
- Loading branch information
Showing
8 changed files
with
158 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[Unit] | ||
Description=gunicorn daemon | ||
Requires=gunicorn.socket | ||
After=network.target | ||
|
||
[Service] | ||
User=weblate | ||
Group=weblate | ||
WorkingDirectory=/home/weblate/weblate-env/ | ||
Environment="DJANGO_SETTINGS_MODULE=weblate.settings" | ||
ExecStart=/home/weblate/weblate-env/bin/gunicorn \ | ||
--preload \ | ||
--timeout 3600 \ | ||
--graceful-timeout 3600 \ | ||
--worker-class=gthread \ | ||
--workers=2 \ | ||
--threads=16 \ | ||
--bind unix:/run/gunicorn.sock \ | ||
weblate.wsgi:application | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Copyright © Michal Čihař <[email protected]> | ||
|
||
SPDX-License-Identifier: GPL-3.0-or-later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Unit] | ||
Description=gunicorn socket | ||
|
||
[Socket] | ||
ListenStream=/run/gunicorn.sock | ||
|
||
[Install] | ||
WantedBy=sockets.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Copyright © Michal Čihař <[email protected]> | ||
|
||
SPDX-License-Identifier: GPL-3.0-or-later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# | ||
# nginx configuration for Weblate | ||
# | ||
# You will want to change: | ||
# | ||
# - server_name | ||
# - change /home/weblate/weblate-env to location where Weblate virtualenv is placed | ||
# - change /home/weblate/data to match your DATA_DIR | ||
# - change /home/weblate/data/cache to match your CACHE_DIR | ||
# - change python3.12 to match your Python version | ||
# - change weblate user to match your Weblate user | ||
# | ||
server { | ||
listen 80; | ||
server_name weblate; | ||
# Not used | ||
root /var/www/html; | ||
|
||
location ~ ^/favicon.ico$ { | ||
# CACHE_DIR/static/favicon.ico | ||
alias /home/weblate/data/cache/static/favicon.ico; | ||
expires 30d; | ||
} | ||
|
||
location /static/ { | ||
# CACHE_DIR/static/ | ||
alias /home/weblate/data/cache/static/; | ||
expires 30d; | ||
} | ||
|
||
location /media/ { | ||
# DATA_DIR/media/ | ||
alias /home/weblate/data/media/; | ||
expires 30d; | ||
} | ||
|
||
location / { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
proxy_pass http://unix:/run/gunicorn.sock; | ||
proxy_read_timeout 3600; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Copyright © Michal Čihař <[email protected]> | ||
|
||
SPDX-License-Identifier: GPL-3.0-or-later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters