Skip to content

Commit

Permalink
fix: Update server_name to use SERVER_NAME variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Armadillidiid committed Mar 17, 2024
1 parent 6b694fa commit fc9f446
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
environment:
- APP_HOST=app
- APP_PORT=8000
- SERVER_NAME=${SERVER_NAME}
- VIRTUAL_HOST=${SERVER_NAME},www.${SERVER_NAME}
- LETSENCRYPT_HOST=${SERVER_NAME}
volumes:
Expand Down
6 changes: 3 additions & 3 deletions nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
server {
listen 80;
server_name www.${VIRTUAL_HOST};
server_name www.${SERVER_NAME};

# Redirect www to non-www over HTTPS
return 301 https://${VIRTUAL_HOST}$request_uri;
return 301 https://${SERVER_NAME}$request_uri;
}

server {
listen 80;
server_name ${VIRTUAL_HOST};
server_name ${SERVER_NAME};

location /static {
alias /app/staticfiles/;
Expand Down

0 comments on commit fc9f446

Please sign in to comment.