Spaces:
Running
Running
BinaryONe
commited on
Commit
·
7601e69
1
Parent(s):
a0e5aad
Nginx Changes
Browse files- Dockerfile +3 -2
- default_conf.conf +20 -0
- nginx-new.conf +28 -0
Dockerfile
CHANGED
@@ -5,7 +5,8 @@ RUN apk update && apk upgrade && \
|
|
5 |
apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates openrc
|
6 |
|
7 |
# Create a group and user
|
8 |
-
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
|
9 |
|
10 |
# Remove sudoers entries (highly recommended)
|
11 |
#RUN echo "appuser ALL=(ALL:ALL) ALL" >> /etc/sudoers
|
@@ -31,7 +32,7 @@ COPY www.privateone-teleapi.hf.space.conf /etc/nginx/conf.d/www.privateone-telea
|
|
31 |
# Create necessary directories and set correct permissions (fix ownership)
|
32 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
33 |
chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
|
34 |
-
chown -R
|
35 |
|
36 |
# Remove the user directive from the main nginx.conf (not needed)
|
37 |
#RUN sed -i '/^user /d' /etc/nginx/nginx.conf
|
|
|
5 |
apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates openrc
|
6 |
|
7 |
# Create a group and user
|
8 |
+
#RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
9 |
+
RUN adduser -D -g 'user' user
|
10 |
|
11 |
# Remove sudoers entries (highly recommended)
|
12 |
#RUN echo "appuser ALL=(ALL:ALL) ALL" >> /etc/sudoers
|
|
|
32 |
# Create necessary directories and set correct permissions (fix ownership)
|
33 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
34 |
chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
|
35 |
+
chown -R user:user /app /var/www/html /var/lib/nginx && chmod -R 777 /app
|
36 |
|
37 |
# Remove the user directive from the main nginx.conf (not needed)
|
38 |
#RUN sed -i '/^user /d' /etc/nginx/nginx.conf
|
default_conf.conf
CHANGED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
server { # ONLY the server block
|
2 |
+
listen 7860;
|
3 |
+
|
4 |
+
proxy_buffering off;
|
5 |
+
proxy_cache off;
|
6 |
+
sendfile on;
|
7 |
+
tcp_nopush on;
|
8 |
+
tcp_nodelay on;
|
9 |
+
|
10 |
+
location / {
|
11 |
+
proxy_pass http://127.0.0.1:8080;
|
12 |
+
proxy_set_header Host $host;
|
13 |
+
proxy_set_header X-Real-IP $remote_addr;
|
14 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
15 |
+
proxy_set_header Range $http_range;
|
16 |
+
proxy_set_header If-Range $http_if_range;
|
17 |
+
|
18 |
+
add_header Accept-Ranges bytes;
|
19 |
+
}
|
20 |
+
}
|
nginx-new.conf
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
user user;
|
2 |
+
worker_processes auto; # it will be determinate automatically by the number of core
|
3 |
+
|
4 |
+
error_log /var/log/nginx/error.log warn;
|
5 |
+
pid /var/run/nginx/nginx.pid; # it permit you to use rc-service nginx reload|restart|stop|start
|
6 |
+
|
7 |
+
events {
|
8 |
+
worker_connections 1024;
|
9 |
+
}
|
10 |
+
|
11 |
+
http {
|
12 |
+
include /etc/nginx/mime.types;
|
13 |
+
default_type application/octet-stream;
|
14 |
+
sendfile on;
|
15 |
+
access_log /var/log/nginx/access.log;
|
16 |
+
keepalive_timeout 3000;
|
17 |
+
server {
|
18 |
+
listen 7860;
|
19 |
+
root /www;
|
20 |
+
index index.html index.htm;
|
21 |
+
server_name localhost;
|
22 |
+
client_max_body_size 32m;
|
23 |
+
error_page 500 502 503 504 /50x.html;
|
24 |
+
location = /50x.html {
|
25 |
+
root /var/lib/nginx/html;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|