mirror of
https://github.com/Thumbscrew/nextcloud-docker-compose.git
synced 2025-07-03 03:19:05 +00:00
add nginx service
This commit is contained in:
9
nginx/Dockerfile
Normal file
9
nginx/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM nginx:latest
|
||||
|
||||
COPY default.conf /tmp/nginx/default.conf
|
||||
|
||||
COPY docker-entrypoint.sh /tmp/docker-entrypoint.sh
|
||||
RUN chmod 755 /tmp/docker-entrypoint.sh
|
||||
ENTRYPOINT [ "/tmp/docker-entrypoint.sh" ]
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
29
nginx/default.conf
Normal file
29
nginx/default.conf
Normal file
@ -0,0 +1,29 @@
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
ssl_certificate /etc/ssl/certs/server.cert.pem;
|
||||
ssl_certificate_key /etc/ssl/private/server.key.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://nextcloud:80;
|
||||
proxy_headers_hash_max_size 512;
|
||||
proxy_headers_hash_bucket_size 64;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
add_header Front-End-Https on;
|
||||
client_max_body_size 1G;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
if ($host = ${NGINX_HOST}) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
listen 80;
|
||||
|
||||
server_name ${NGINX_HOST};
|
||||
}
|
6
nginx/docker-entrypoint.sh
Normal file
6
nginx/docker-entrypoint.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
envsubst '${NGINX_HOST}' < /tmp/nginx/default.conf > /etc/nginx/conf.d/default.conf
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user