Skip to content

Commit

Permalink
opt: 支持客户定义https配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
finovy committed Oct 12, 2023
1 parent 25646f8 commit e300332
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
container_name: archery
restart: always
ports:
- "443:443"
- "9123:9123"
volumes:
- "./archery/settings.py:/opt/archery/local_settings.py"
Expand All @@ -45,6 +46,8 @@ services:
- "./archery/sql/migrations:/opt/archery/sql/migrations"
- "./archery/logs:/opt/archery/logs"
- "./archery/keys:/opt/archery/keys"
- "./nginx/https.conf:/etc/nginx/conf.d/https.conf"
- "./nginx/ssl:/etc/nginx/ssl"
entrypoint: "dockerize -wait tcp://mysql:3306 -wait tcp://redis:6379 -timeout 60s /opt/archery/src/docker/startup.sh"
env_file:
- .env
31 changes: 31 additions & 0 deletions src/docker-compose/nginx/https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
server {
listen 443 ssl;
server_name archery.your-project.com;
ssl_certificate /etc/nginx/ssl/STAR_internal-project_com.crt;
ssl_certificate_key /etc/nginx/ssl/STAR_internal-project_com.key;
ssl_session_timeout 5m;
client_max_body_size 20M;
proxy_read_timeout 600s;

location / {
proxy_pass http://127.0.0.1:8888;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

location /static {
alias /opt/archery/static;
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}

}
Empty file.
Empty file.

0 comments on commit e300332

Please sign in to comment.