serve static files over nginx

This commit is contained in:
b1ek 2023-06-06 18:32:32 +10:00 committed by blek
parent 9c0bfe1f42
commit 735b55904f
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 14 additions and 0 deletions

View File

@ -22,10 +22,22 @@ http {
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
gzip on;
gzip_types text/plain application/json application/x-json application/javascript application/x-javascript text/css text/x-css;
gzip_min_length 1024;
gzip_static on;
server {
listen 80;
location / {
proxy_pass http://server;
}
location /static {
root /var/www;
gzip_static on;
}
location /announce.json/ {
root /var/www;
}
}
}

View File

@ -28,6 +28,7 @@ services:
- homepage
volumes:
- './config/nginx:/etc/nginx'
- './public:/var/www:ro'
db:
image: postgres:alpine
ports:

View File

@ -25,6 +25,7 @@ services:
- homepage
volumes:
- './config/nginx:/etc/nginx'
- './public:/var/www:ro'
db:
restart: always
image: postgres:alpine