-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
231 lines (203 loc) · 7.32 KB
/
nginx.conf
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
# /etc/nginx/nginx.conf
user nginx;
# Set number of worker processes automatically based on number of CPU cores.
worker_processes 2;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;
# Configures default error logger.
error_log /var/log/nginx/error.log warn;
# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;
events {
# The maximum number of simultaneous connections that can be opened by
# a worker process.
worker_connections 1024;
use epoll;
accept_mutex off;
}
http {
include /etc/nginx/mime.types;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 180;
client_max_body_size 300m;
client_body_buffer_size 128k;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 6;
gzip_min_length 0;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types text/plain text/css text/xml text/javascript application/xml application/xml+rss application/javascript application/json;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
include /etc/nginx/conf.d/*.conf;
# ref: https://confluence.atlassian.com/jirakb/integrating-jira-with-nginx-426115340.html
server {
server_name jira.muncic.local; # DNS A record
listen 0.0.0.0:8080; # can be substituted with actual IP container is listening on
access_log /var/log/nginx/jira.log combined;
location / {
proxy_set_header Host $host; # optional
proxy_set_header X-Forwarded-Host $host; # mandatory prescribed by Atlassian
proxy_set_header X-Forwarded-Server $host; # mandatory prescribed by Atlassian
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # mandatory prescribed by Atlassian
proxy_pass http://192.168.1.35:8585; # points to machine where JIRA is running on; mandatory
proxy_set_header Authorization $http_authorization; # optional
proxy_read_timeout 180;
client_max_body_size 10M; # recommended by Atlassian
}
}
server {
server_name sonarr.muncic.local; # DNS A record
listen 0.0.0.0:8080; # can be substituted with actual IP container is listening on
access_log /var/log/nginx/sonarr.log combined;
location / {
proxy_set_header Host $host; # optional
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.35:8989;
proxy_set_header Authorization $http_authorization; # optional
proxy_read_timeout 180;
}
}
server {
server_name sabnzbd.muncic.local; # DNS A record
listen 0.0.0.0:8080; # can be substituted with actual IP container is listening on
access_log /var/log/nginx/sabnzbd.log combined;
location / {
proxy_set_header Host $host; # optional
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.35:8080;
proxy_set_header Authorization $http_authorization; # optional
proxy_read_timeout 180;
}
}
server {
server_name netdata.muncic.local; # DNS A record
listen 0.0.0.0:8080; # can be substituted with actual IP container is listening on
access_log /var/log/nginx/netdata.log combined;
location / {
proxy_set_header Host $host; # optional
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.35:19999;
proxy_set_header Authorization $http_authorization; # optional
proxy_read_timeout 180;
}
}
server {
server_name adminer.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/adminer.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.35:8484;
proxy_set_header Authorization $http_authorization;
}
}
#ref: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy
# - do not add the lines containing
# -- return 301 (..)
# -- proxy redirect (..)
# -> ended in total disaster for me
server {
server_name jenkins.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/jenkins.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://192.168.1.35:9090;
proxy_set_header Authorization $http_authorization;
proxy_connect_timeout 180;
proxy_send_timeout 180;
proxy_read_timeout 180;
proxy_buffer_size 8k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
server {
server_name sonarqube.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/sonarqube.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://192.168.1.35:9000;
proxy_set_header Authorization $http_authorization;
proxy_read_timeout 180;
}
}
server {
server_name radarr.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/radarr.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://192.168.1.35:7878;
proxy_set_header Authorization $http_authorization;
proxy_read_timeout 180;
}
}
server {
server_name kodi.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/kodi.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://192.168.1.24:8080;
proxy_set_header Authorization $http_authorization;
proxy_read_timeout 180;
}
}
server {
server_name bitbucket.muncic.local;
listen 0.0.0.0:8080;
access_log /var/log/nginx/bitbucket.log combined;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://192.168.1.35:7990;
proxy_set_header Authorization $http_authorization;
proxy_read_timeout 180;
}
}
}