This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
162 lines (139 loc) · 4.27 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
events {
}
http {
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
root /usr/share/nginx/html;
include mime.types;
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ipv6only=on ssl;
server_name r-universe.dev cran.dev;
location = / {
return 302 /dashboard/;
}
location /dashboard {
proxy_pass https://r-universe-org.github.io/dashboard;
}
location /webhook {
proxy_set_header Accept "application/vnd.github.v3+json";
proxy_set_header User-Agent "curl/7.64.1";
proxy_set_header Authorization "token $arg_token";
proxy_set_body "{\"ref\":\"master\"}";
proxy_pass https://api.github.com/repos/r-universe-org/setup-universes/actions/workflows/setup.yml/dispatches;
limit_except POST {
deny all;
}
}
location /src {
proxy_pass http://cranlike:3000/:any/src;
proxy_redirect http://cranlike:3000/:any/src $scheme://$host/src;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /bin {
proxy_pass http://cranlike:3000/:any/bin;
proxy_redirect http://cranlike:3000/:any/bin $scheme://$host/bin;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /stats {
proxy_pass http://cranlike:3000/:any/stats;
proxy_redirect http://cranlike:3000/:any/stats $scheme://$host/stats;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /man {
proxy_pass http://cranlike:3000/:any/man;
proxy_redirect http://cranlike:3000/:any/man $scheme://$host/man;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /packages {
proxy_pass http://cranlike:3000/:any/packages;
proxy_redirect http://cranlike:3000/:any/packages $scheme://$host/packages;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location / {
proxy_pass http://cranlike:3000;
proxy_redirect http://cranlike:3000 $scheme://$host;
proxy_request_buffering off;
client_max_body_size 100M;
limit_except GET HEAD {
auth_basic "Authenticate to submit";
auth_basic_user_file /etc/nginx/.htaccess;
}
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 default_server ssl;
# listen [::]:443 ipv6only=on default_server ssl;
server_name jenkins.ropensci.org;
location /docs {
autoindex on;
root /data;
}
location /src {
proxy_pass http://cranlike:3000/ropensci/src;
proxy_redirect http://cranlike:3000/ropensci/src $scheme://$host/src;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /bin {
proxy_pass http://cranlike:3000/ropensci/bin;
proxy_redirect http://cranlike:3000/ropensci/bin $scheme://$host/bin;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /stats {
proxy_pass http://cranlike:3000/ropensci/stats;
proxy_redirect http://cranlike:3000/ropensci/stats $scheme://$host/stats;
proxy_request_buffering off;
limit_except GET HEAD {
deny all;
}
}
location /packages {
proxy_pass http://cranlike:3000/ropensci/packages;
proxy_redirect http://cranlike:3000/ropensci/packages $scheme://$host/packages;
proxy_request_buffering off;
client_max_body_size 100M;
limit_except GET HEAD {
auth_basic "Authenticate to submit";
auth_basic_user_file /etc/nginx/.htaccess;
}
}
location / {
proxy_pass http://jenkins:8080;
proxy_redirect http://jenkins:8080 $scheme://$host;
proxy_set_header Host $host:$server_port;
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_http_version 1.1;
proxy_request_buffering off;
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
}
}
}
}