Spaces:
Running
Running
BinaryONe
commited on
Commit
·
5b3b248
1
Parent(s):
1b09b20
Nginx Changes
Browse files- Dockerfile +11 -10
- www.privateone-teleapi.hf.space.conf +1 -1
Dockerfile
CHANGED
@@ -26,9 +26,16 @@ RUN python3 -m venv /app/venv && \
|
|
26 |
# Copy the rest of the application code
|
27 |
COPY . /app
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
# Copy Nginx config
|
30 |
#COPY www.privateone-teleapi.hf.space.conf /etc/nginx/conf.d/www.privateone-teleapi.hf.space.conf
|
31 |
-
|
32 |
|
33 |
# Create necessary directories and set correct permissions (fix ownership)
|
34 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
@@ -38,15 +45,9 @@ RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
|
38 |
# Remove the user directive from the main nginx.conf (not needed)
|
39 |
#RUN sed -i '/^user /d' /etc/nginx/nginx.conf
|
40 |
|
41 |
-
#You may want to make backup of original nginx.conf file before writting your own
|
42 |
-
RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
|
43 |
-
|
44 |
-
# Print the configuration files to the console (good addition)
|
45 |
-
RUN cat /etc/nginx/nginx.conf && echo "--------------------"
|
46 |
-
# && cat /etc/nginx/conf.d/default.conf
|
47 |
-
|
48 |
# Switch to non-root user
|
49 |
-
USER
|
50 |
|
51 |
# Start Nginx and your application (using exec and the correct Python path)
|
52 |
-
CMD ["sh", "-c", "rc-service nginx reload
|
|
|
|
26 |
# Copy the rest of the application code
|
27 |
COPY . /app
|
28 |
|
29 |
+
#You may want to make backup of original nginx.conf file before writting your own
|
30 |
+
RUN mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
|
31 |
+
|
32 |
+
# Print the configuration files to the console (good addition)
|
33 |
+
RUN cat /etc/nginx/nginx.conf && echo "--------------------"
|
34 |
+
# && cat /etc/nginx/conf.d/default.conf
|
35 |
+
|
36 |
# Copy Nginx config
|
37 |
#COPY www.privateone-teleapi.hf.space.conf /etc/nginx/conf.d/www.privateone-teleapi.hf.space.conf
|
38 |
+
COPY nginx-new.conf /etc/nginx/nginx.conf
|
39 |
|
40 |
# Create necessary directories and set correct permissions (fix ownership)
|
41 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
|
|
45 |
# Remove the user directive from the main nginx.conf (not needed)
|
46 |
#RUN sed -i '/^user /d' /etc/nginx/nginx.conf
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
# Switch to non-root user
|
49 |
+
USER user
|
50 |
|
51 |
# Start Nginx and your application (using exec and the correct Python path)
|
52 |
+
CMD ["sh", "-c", "rc-service nginx reload"]
|
53 |
+
#&& exec /app/venv/bin/python -u -m FileStream
|
www.privateone-teleapi.hf.space.conf
CHANGED
@@ -12,7 +12,7 @@ server {
|
|
12 |
proxy_set_header X-Real-IP $remote_addr;
|
13 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
14 |
proxy_set_header Range $http_range;
|
15 |
-
proxy_set_header If-Range $http_if_range;
|
16 |
add_header Accept-Ranges bytes;
|
17 |
}
|
18 |
}
|
|
|
12 |
proxy_set_header X-Real-IP $remote_addr;
|
13 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
14 |
proxy_set_header Range $http_range;
|
15 |
+
proxy_set_header If-Range $http_if_range;
|
16 |
add_header Accept-Ranges bytes;
|
17 |
}
|
18 |
}
|