-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgemeni
345 lines (137 loc) · 5.38 KB
/
gemeni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
this is my nginx setting in docker compose file : nginx:
container_name: nginx
image: nginx:1.27.3
command: nginx -g 'daemon off;'
ports:
- "80:80"
networks:
- main
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- app , and this is my nginx.conf :
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
worker_rlimit_nofile 3048;
events {
worker_connections 1024;
multi_accept off;
use epoll;
}
http{
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75s;
#keepalive_requests 1000;
proxy_send_timeout 75s;
proxy_read_timeout 120s;
proxy_connect_timeout 120s;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=mycache:150m inactive=3h max_size=40g;
# limit_conn_zone $binary_remote_addr zone=liconn:15m;
# limit_req_zone $binary_remote_addr zone=lireq:15m rate=10r/s;
# limit_req_status 429;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
client_max_body_size 350m;
open_file_cache max=500 inactive=30s;
#open_file_cache_valid 60s;
#open_file_cache_min_uses 4;
open_file_cache_errors off;
##
# Gzip Settings
##
gzip on;
gzip_min_length 100;
gzip_comp_level 6;
#gzip_disable "msie6";
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
map $http_user_agent $ua {
'' "Fixing-Empty-User-Agent";
default $http_user_agent;
}
server{
listen 80;
server_name www.storeyab.ir storeyab.ir;
return 301 $scheme://storeyab.com$request_uri;
#rewrite ^/(.*) https://storeyab.com/$1 permanent;
}
server{
server_name www.storeyab.com;
listen 80;
return 301 $scheme://storeyab.com$request_uri;
#rewrite ^/(.*) https://storeyab.com/$1 permanent;
}
server{
server_name storeyab.com;
#listen 80;
#deny some_ip_address;
# #limit_conn liconn 10;
# #limit_req zone=lireq burst=8;
location = /favicon.ico { access_log off; log_not_found off; }
location /static_in_env/ {
root /home/mhfd/newblog17/blog23;
}
location / {
#proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Accept-Encoding "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/home/mhfd/newblog17/blog23/blog23.sock;
proxy_cache mycache;
proxy_cache_valid 404 5m;
proxy_cache_key "Shost$request_uri $cookie_user";
proxy_cache_bypass $http_cache_bypass;
proxy_cache_bypass $arg_should_bypass_cache;
#proxy_cache_use_stale error http_500 http_503;
proxy_connect_timeout 60s;
proxy_cache_lock on;
add_header X-Proxy-Cache $upstream_cache_status;
}
location /ws/ {
proxy_pass http://0.0.0.0:9000;
proxy_http_version 1.1;
proxy_read_timeout 86400;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header User-Agent: $ua;
}
}
}
, but i got this error : 2025/01/16 16:10:29 [emerg] 1#1: mkdir() "/data/nginx/cache" failed (2: No such file or directory)
nginx: [emerg] mkdir() "/data/nginx/cache" failed (2: No such file or directory)
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2025/01/16 16:11:33 [emerg] 1#1: mkdir() "/data/nginx/cache" failed (2: No such file or directory)
nginx: [emerg] mkdir() "/data/nginx/cache" failed (2: No such file or directory)