解决了子域名无法访问和会访问到管理后台的问题

This commit is contained in:
yoh0o
2024-06-23 22:51:48 +08:00
parent cb8dc15738
commit d1e70c33db
3 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ pyenv virtualenv 3.8.2 dnslog
~/.pyenv/versions/dnslog/bin/python manage.py collectstatic
~/.pyenv/versions/dnslog/bin/gunicorn --workers 5 --bind 127.0.0.1:8000 dnslog.wsgi:application --daemon
nohup ~/.pyenv/versions/3.8.2/envs/dnslog/bin/python3.8 ./zoneresolver.py &
envsubst '$ADMIN_DOMAIN' < /dnslog/dnslog_nginx.conf > /etc/nginx/conf.d/default.conf
envsubst '$ADMIN_DOMAIN,$DNS_DOMAIN' < /dnslog/dnslog_nginx.conf > /etc/nginx/conf.d/default.conf
setsebool httpd_can_network_connect on
setenforce permissive
systemctl restart nginx
+2 -5
View File
@@ -1,15 +1,12 @@
server {
listen 80;
server_name localhost $ADMIN_DOMAIN;
server_name localhost $ADMIN_DOMAIN *.$DNS_DOMAIN;
uwsgi_pass_request_headers on;
if ($request_uri ~* "^/$") {
return 302 $scheme://$http_host/login;
}
location = /favicon.ico {
access_log off; log_not_found off;
}
location /static/ {
alias /dnslog/static/;
}
+1 -1
View File
@@ -44,7 +44,7 @@ services:
- 53:53/tcp
- 53:53/udp
- 8080:80/tcp
command: /bin/bash -c "envsubst '$$ADMIN_DOMAIN' < /dnslog/dnslog_nginx.conf > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
command: /bin/bash -c "envsubst '$$ADMIN_DOMAIN,$$DNS_DOMAIN' < /dnslog/dnslog_nginx.conf > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
healthcheck:
test: "wget -nv -t1 --spider http://localhost/login --no-check-certificate > /dev/null"
interval: 10s