blob: 7b3e620affb9642dc2dc2db5a16efbcafc07d76a [file] [log] [blame]
ecaiyanlinux6cad5d92022-01-12 12:10:04 +01001# user www-data;
ecaiyanlinux9ab67f52020-05-14 15:11:45 +02002worker_processes auto;
3pid /run/nginx.pid;
4include /etc/nginx/modules-enabled/*.conf;
5
RehanRazad7287812020-05-29 17:46:40 +02006env ALLOW_HTTP;
7
ecaiyanlinux9ab67f52020-05-14 15:11:45 +02008events {
9 worker_connections 768;
10 # multi_accept on;
11}
12
13http {
14
15 ##
16 # Basic Settings
17 ##
18
19 sendfile on;
20 tcp_nopush on;
21 tcp_nodelay on;
22 keepalive_timeout 65;
23 types_hash_max_size 2048;
24 # server_tokens off;
25
26 # server_names_hash_bucket_size 64;
27 # server_name_in_redirect off;
28
29 include /etc/nginx/mime.types;
30 default_type application/octet-stream;
31
RehanRazad7287812020-05-29 17:46:40 +020032 perl_set $allow_http 'sub { return $ENV{"ALLOW_HTTP"}; }';
33
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020034 server { # simple reverse-proxy
RehanRazad7287812020-05-29 17:46:40 +020035 listen 8085;
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020036 listen [::]:8085;
RehanRazad7287812020-05-29 17:46:40 +020037 server_name localhost;
38 if ($allow_http != true) {
39 return 444;
40 }
41
42 # serve dynamic requests
43 location / {
44 proxy_set_header Host $host;
45 proxy_set_header X-Real-IP $remote_addr;
46 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
47 proxy_pass http://localhost:2222;
48 }
49 }
50
51 server { # simple reverse-proxy
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020052 listen 8185 ssl;
53 listen [::]:8185 ssl;
54 server_name localhost;
55 ssl_certificate /usr/src/app/cert/cert.crt;
56 ssl_certificate_key /usr/src/app/cert/key.crt;
57 ssl_password_file /usr/src/app/cert/pass;
58
59 # serve dynamic requests
60 location / {
ecaiyanlinuxdceaf392020-05-18 14:40:53 +020061 proxy_set_header Host $host;
62 proxy_set_header X-Real-IP $remote_addr;
63 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
64 proxy_pass http://localhost:2222;
ecaiyanlinux9ab67f52020-05-14 15:11:45 +020065 }
66 }
67 ##
68 # SSL Settings
69 ##
70
71 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
72 ssl_prefer_server_ciphers on;
73
74 ##
75 # Logging Settings
76 ##
77
78 access_log /var/log/nginx/access.log;
79 error_log /var/log/nginx/error.log;
80
81 ##
82 # Gzip Settings
83 ##
84
85 gzip on;
86
87 # gzip_vary on;
88 # gzip_proxied any;
89 # gzip_comp_level 6;
90 # gzip_buffers 16 8k;
91 # gzip_http_version 1.1;
92 # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
ecaiyanlinux3f519ca2022-02-21 12:31:15 +010093}