我有一个 django 网站,它是使用 NGINX 和 gunicorn 设置的。
/etc/systemd/system/gunicorn.socket:
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/gunicorn.sock
[Install]
WantedBy=sockets.target
/etc/systemd/system/gunicorn.service:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=*****
Group=www-data
WorkingDirectory=*****/mysite
ExecStart=gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
mysite.wsgi:application
[Install]
WantedBy=multi-user.target
/etc/nginx/sites-available/mysite.conf
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
server_name ******;
access_log /var/log/nginx/mysite.access.log;
error_log /var/log/nginx/mysite.error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root *****/mysite;
}
location /media/ {
root *****/mysite/static;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
我已经安装跟踪不久前作为一个独立的进程:
tracd -s --port 8765 --basic-auth=\
"my_trac,*****/trac/.htpasswd,My Env" *****/trac/my_trac/
我想将 trac 添加到我的 nginx/gunicorn/django 设置中,以便我可以通过以下方式访问它:https://example.com/trac
而不是http://example.com:8765
我能得到一些帮助吗?