-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
68 lines (51 loc) · 1.65 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
server {
listen 80;
large_client_header_buffers 4 32k;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443;
large_client_header_buffers 4 32k;
ssl on;
ssl_certificate /etc/ssl/bundle.crt;
ssl_certificate_key /etc/ssl/private.key;
add_header P3P 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"';
add_header "Cache-Control" "max-age=0, no-cache, no-store, must-revalidate";
server_name _;
gzip on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
set $htpasswd_file /home/app/oav_website/public/.htpasswd;
set $auth_basic off;
if (-f $htpasswd_file) {
set $auth_basic "Test voting / prufu kosningar";
}
proxy_set_header X-Forwarded-Proto https;
location / {
auth_basic_user_file $htpasswd_file;
auth_basic $auth_basic;
if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|Slackbot|developers\.google\.com") {
rewrite ^ /votes/meta.html last;
}
root /home/app/oav_website/public/dist;
try_files $uri $uri/ /index.html;
}
location /items {
passenger_app_root /home/app/oav_website;
passenger_enabled on;
passenger_user app;
passenger_ruby /usr/bin/ruby2.7;
}
location /votes {
passenger_app_root /home/app/oav_website;
passenger_enabled on;
passenger_user app;
passenger_ruby /usr/bin/ruby2.7;
}
location /authenticate_from_island_is {
passenger_app_root /home/app/oav_website;
passenger_enabled on;
passenger_user app;
passenger_ruby /usr/bin/ruby2.7;
}
}