Skip to content

Commit

Permalink
Update web_nginx to use public_nginx.conf
Browse files Browse the repository at this point in the history
- Also use restart: unless-stopped for consistency
  • Loading branch information
cdrini committed Nov 25, 2021
1 parent b00c980 commit 43f8b2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ services:
web_haproxy:
profiles: ["ol-www0"]
image: haproxy:2.3.5
restart: always
restart: unless-stopped
hostname: "$HOSTNAME"
networks:
- webnet
Expand All @@ -140,7 +140,7 @@ services:
max-file: "4"
web_nginx:
profiles: ["ol-www0"]
restart: always
restart: unless-stopped
hostname: "ol-www0" # always want this hostname (or nginx backups will be misnamed)
image: "${OLIMAGE:-openlibrary/olbase:latest}"
user: root
Expand All @@ -150,8 +150,9 @@ services:
volumes:
# nginx configurations
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
- ../olsystem/etc/nginx/sites-available/default-docker.conf:/etc/nginx/sites-enabled/default:ro
- ./docker/web_nginx.conf:/etc/nginx/sites-enabled/openlibrary.conf:ro
# Needed for HTTPS, since this is a public server
- ./docker/public_nginx.conf:/etc/nginx/sites-available/public_nginx.conf:ro
# archive web log uploads
- ../olsystem:/olsystem
# web log rotation
Expand Down
7 changes: 2 additions & 5 deletions docker/web_nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ upstream webnodes {
}

server {
listen 80;
listen 443;
include /etc/nginx/sites-available/public_nginx.conf;
server_name openlibrary.org;

# Set the referrer policy so browsers send referrers to our own servers
Expand Down Expand Up @@ -88,9 +87,7 @@ server {
}

server {
listen 80;
listen 443;

include /etc/nginx/sites-available/public_nginx.conf;
server_name www.openlibrary.org *.openlibrary.org;

rewrite ^(.*)$ http://openlibrary.org$1 permanent;
Expand Down

0 comments on commit 43f8b2c

Please sign in to comment.