blob: 1978248047b9ac750c1677d77a3b6cc1124ddc32 [file] [log] [blame]
Nico Huberf3193602023-07-02 14:56:01 +00001proxy_cache_path /var/cache/nginx/gerrit levels=2 keys_zone=GERRIT:1m inactive=1w max_size=16m;
2
Nico Huber8cd50ee2023-06-24 15:35:16 +00003server {
Nico Huber38c14da2023-06-24 16:59:28 +00004 listen 80;
5 listen [::]:80;
6
Nico Huber15edd772023-07-01 18:16:50 +00007 location /.well-known/acme-challenge/ {
8 root /var/www/certbot;
9 }
10
11 location / {
12 return 301 https://$host$request_uri;
13 }
Nico Huber38c14da2023-06-24 16:59:28 +000014}
15
16server {
17 listen 443 ssl;
18 listen [::]:443 ssl;
Nico Hubera1a296f2023-06-25 10:07:07 +000019
20 server_name id.miau.local;
21
Nico Huberf4fbab52023-07-25 10:57:08 +000022 location /auth/ { # Gerrit adds this prefix for Keycloak...
23 rewrite ^/auth(.*)$ $1 last;
24 }
25
26 location / {
27 proxy_pass http://keycloak:8080;
28 proxy_set_header X-Forwarded-For $remote_addr;
29 proxy_set_header Host $host;
30 }
Nico Hubera1a296f2023-06-25 10:07:07 +000031}
32
33server {
34 listen 443 ssl default_server;
35 listen [::]:443 ssl default_server;
Nico Huber15edd772023-07-01 18:16:50 +000036 ssl_certificate /etc/nginx/certs/live/miau.local/fullchain.pem;
37 ssl_certificate_key /etc/nginx/certs/live/miau.local/privkey.pem;
Nico Huber38c14da2023-06-24 16:59:28 +000038 ssl_protocols TLSv1.3;
39 ssl_prefer_server_ciphers on;
40 #ssl_dhparam /etc/nginx/dhparam.pem;
41 ssl_ciphers EECDH+AESGCM:EDH+AESGCM;
42 ssl_ecdh_curve secp384r1;
43 ssl_session_timeout 10m;
44 ssl_session_cache shared:SSL:10m;
45 ssl_session_tickets off;
46 ssl_stapling on;
47 ssl_stapling_verify on;
48 resolver 8.8.8.8 8.8.4.4 valid=300s;
49 resolver_timeout 5s;
50 # Disable strict transport security for now. You can uncomment the following
51 # line if you understand the implications.
52 #add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
53 add_header X-Frame-Options DENY;
54 add_header X-Content-Type-Options nosniff;
55 add_header X-XSS-Protection "1; mode=block";
Nico Huber8cd50ee2023-06-24 15:35:16 +000056
Nico Hubera1a296f2023-06-25 10:07:07 +000057 server_name review.miau.local;
Nico Huber8cd50ee2023-06-24 15:35:16 +000058
Nico Huber8cd50ee2023-06-24 15:35:16 +000059 location / {
Nico Hubera1a296f2023-06-25 10:07:07 +000060 proxy_pass http://gerrit:8080;
61 proxy_set_header X-Forwarded-For $remote_addr;
62 proxy_set_header Host $host;
Nico Huberf3193602023-07-02 14:56:01 +000063
64 location ~ ^/(bower_components|elements|fonts|styles)/ {
65 proxy_pass http://gerrit:8080;
66 proxy_set_header X-Forwarded-For $remote_addr;
67 proxy_set_header Host $host;
68 proxy_cache GERRIT;
69 proxy_cache_valid 200 1h;
70 proxy_cache_use_stale error timeout invalid_header updating http_500 http_503;
71 # Gerrit bug sets `private`, hence the whole location override:
72 proxy_ignore_headers Cache-Control;
73 }
Nico Huber8cd50ee2023-06-24 15:35:16 +000074 }
75}