Spaces:
Running
Running
BinaryONe
commited on
Commit
·
a11228a
1
Parent(s):
8d7ff77
Nginx Changes-Over Alpine
Browse files- Dockerfile +4 -3
- default_conf.conf +0 -0
- nginx copy.conf +20 -0
- nginx.conf +23 -16
Dockerfile
CHANGED
@@ -21,10 +21,11 @@ RUN python3 -m venv /app/venv && \
|
|
21 |
COPY . /app
|
22 |
|
23 |
# Copy Nginx config
|
24 |
-
COPY
|
|
|
25 |
|
26 |
-
RUN touch /var/lib/nginx/logs/error.log && \
|
27 |
-
chmod 777 /var/lib/nginx/logs/error.log
|
28 |
|
29 |
# Create necessary directories and set correct permissions
|
30 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
|
|
21 |
COPY . /app
|
22 |
|
23 |
# Copy Nginx config
|
24 |
+
COPY default_conf.conf /etc/nginx/conf.d/default.conf
|
25 |
+
COPY nginx.conf /etc/nginx/nginx.conf
|
26 |
|
27 |
+
#RUN touch /var/lib/nginx/logs/error.log && \
|
28 |
+
# chmod 777 /var/lib/nginx/logs/error.log
|
29 |
|
30 |
# Create necessary directories and set correct permissions
|
31 |
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
default_conf.conf
ADDED
File without changes
|
nginx copy.conf
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
server {
|
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.conf
CHANGED
@@ -1,20 +1,27 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
sendfile on;
|
7 |
tcp_nopush on;
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
add_header Accept-Ranges bytes;
|
19 |
-
}
|
20 |
}
|
|
|
1 |
+
worker_processes auto;
|
2 |
+
pcre_jit on;
|
3 |
+
error_log /var/log/nginx/error.log warn;
|
4 |
+
include /etc/nginx/modules/*.conf;
|
5 |
|
6 |
+
events {
|
7 |
+
worker_connections 1024;
|
8 |
+
}
|
9 |
+
|
10 |
+
http { # ONLY ONE http block here
|
11 |
+
include /etc/nginx/mime.types;
|
12 |
+
default_type application/octet-stream;
|
13 |
+
server_tokens off;
|
14 |
+
client_max_body_size 1m;
|
15 |
sendfile on;
|
16 |
tcp_nopush on;
|
17 |
+
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
|
18 |
+
ssl_prefer_server_ciphers on;
|
19 |
+
ssl_session_cache shared:SSL:2m;
|
20 |
+
ssl_session_timeout 1h;
|
21 |
+
ssl_session_tickets off;
|
22 |
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
23 |
+
'$status $body_bytes_sent "$http_referer" '
|
24 |
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
25 |
+
access_log /var/log/nginx/access.log main;
|
26 |
+
include /etc/nginx/conf.d/*.conf; # Include conf.d files HERE
|
|
|
|
|
27 |
}
|