Skip to content

Commit d9fff6d

Browse files
Small improvements
1 parent 84368d3 commit d9fff6d

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@ RUN apt-get update && \
66
DEBIAN_FRONTEND=noninteractive apt-get -yq install nginx && \
77
rm -rf /var/lib/apt/lists/*
88

9-
# Delete default configuration
9+
# Replace configuration
1010
RUN rm -v /etc/nginx/nginx.conf
1111
ADD nginx.conf /etc/nginx/
1212

13-
# Replace configuration
13+
# Add run script
1414
ADD run.sh /run.sh
1515
RUN chmod 755 /*.sh
1616

1717
# Set reverse proxy domain
1818
ENV REVERSE_DOMAIN example.com
1919

20-
# Start Nginx
21-
#CMD sed -i "s/_REPLACE_ME_/$REVERSE_DOMAIN/g" /etc/nginx/nginx.conf && tail -F /var/log/nginx/* & /usr/sbin/nginx
22-
#CMD ["/etc/nginx/run.sh"]
23-
2420
# Expose and start
2521
EXPOSE 80
2622
CMD ["/run.sh"]

nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ http {
1414

1515
location / {
1616
proxy_pass http://_REPLACE_ME_/;
17-
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
17+
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404 http_403 http_300 http_301 http_303;
1818
proxy_redirect off;
1919
proxy_buffering off;
2020
proxy_set_header Host _REPLACE_ME_;

run.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#!/bin/bash
22

33
echo "Configuring Nginx Reverse Proxy..."
4-
54
sed -i "s/_REPLACE_ME_/$REVERSE_DOMAIN/g" /etc/nginx/nginx.conf
65

76
echo "Starting Nginx Reverse Proxy..."
8-
9-
tail -F /var/log/nginx/* &
10-
exec /usr/sbin/nginx
7+
exec /usr/sbin/nginx & tail -F /var/log/nginx/*

0 commit comments

Comments
 (0)