Spaces:
Runtime error
Runtime error
Pedot commited on
Commit ·
0789327
1
Parent(s): 2a83bc3
Fix nginx: move gzip to conf.d/gzip.conf, remove from site config to avoid duplicate directive
Browse files- Dockerfile +3 -0
- nginx.conf +1 -8
Dockerfile
CHANGED
|
@@ -21,6 +21,9 @@ RUN rm -f /etc/nginx/sites-enabled/default && \
|
|
| 21 |
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default && \
|
| 22 |
ls -la /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
# Nginx: disable daemon (supervisor runs it as foreground)
|
| 25 |
# Insert 'daemon off;' at the very TOP of nginx.conf (before events{} block)
|
| 26 |
RUN sed -i '1s/^/daemon off;\n/' /etc/nginx/nginx.conf
|
|
|
|
| 21 |
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default && \
|
| 22 |
ls -la /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
|
| 23 |
|
| 24 |
+
# Nginx: override gzip settings in conf.d (avoids duplicate directive with Debian defaults)
|
| 25 |
+
RUN printf 'gzip on;\ngzip_vary on;\ngzip_min_length 256;\ngzip_proxied any;\ngzip_comp_level 5;\ngzip_types text/plain text/css text/html application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;\n' > /etc/nginx/conf.d/gzip.conf
|
| 26 |
+
|
| 27 |
# Nginx: disable daemon (supervisor runs it as foreground)
|
| 28 |
# Insert 'daemon off;' at the very TOP of nginx.conf (before events{} block)
|
| 29 |
RUN sed -i '1s/^/daemon off;\n/' /etc/nginx/nginx.conf
|
nginx.conf
CHANGED
|
@@ -1,11 +1,4 @@
|
|
| 1 |
-
# nginx.conf —
|
| 2 |
-
|
| 3 |
-
gzip on;
|
| 4 |
-
gzip_vary on;
|
| 5 |
-
gzip_min_length 256;
|
| 6 |
-
gzip_proxied any;
|
| 7 |
-
gzip_comp_level 5;
|
| 8 |
-
gzip_types text/plain text/css text/html application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
| 9 |
|
| 10 |
server {
|
| 11 |
listen 80;
|
|
|
|
| 1 |
+
# nginx.conf — serve landing.html / proxy /dashboard to Streamlit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
server {
|
| 4 |
listen 80;
|